aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet/dn_fib.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/decnet/dn_fib.c')
-rw-r--r--net/decnet/dn_fib.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c
index 27ea2e9b080a..4ab96c15166d 100644
--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -20,6 +20,7 @@
20#include <linux/string.h> 20#include <linux/string.h>
21#include <linux/net.h> 21#include <linux/net.h>
22#include <linux/socket.h> 22#include <linux/socket.h>
23#include <linux/slab.h>
23#include <linux/sockios.h> 24#include <linux/sockios.h>
24#include <linux/init.h> 25#include <linux/init.h>
25#include <linux/skbuff.h> 26#include <linux/skbuff.h>
@@ -509,7 +510,7 @@ static int dn_fib_rtm_delroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *
509 struct rtattr **rta = arg; 510 struct rtattr **rta = arg;
510 struct rtmsg *r = NLMSG_DATA(nlh); 511 struct rtmsg *r = NLMSG_DATA(nlh);
511 512
512 if (net != &init_net) 513 if (!net_eq(net, &init_net))
513 return -EINVAL; 514 return -EINVAL;
514 515
515 if (dn_fib_check_attr(r, rta)) 516 if (dn_fib_check_attr(r, rta))
@@ -529,7 +530,7 @@ static int dn_fib_rtm_newroute(struct sk_buff *skb, struct nlmsghdr *nlh, void *
529 struct rtattr **rta = arg; 530 struct rtattr **rta = arg;
530 struct rtmsg *r = NLMSG_DATA(nlh); 531 struct rtmsg *r = NLMSG_DATA(nlh);
531 532
532 if (net != &init_net) 533 if (!net_eq(net, &init_net))
533 return -EINVAL; 534 return -EINVAL;
534 535
535 if (dn_fib_check_attr(r, rta)) 536 if (dn_fib_check_attr(r, rta))
@@ -607,8 +608,8 @@ static void dn_fib_del_ifaddr(struct dn_ifaddr *ifa)
607 ASSERT_RTNL(); 608 ASSERT_RTNL();
608 609
609 /* Scan device list */ 610 /* Scan device list */
610 read_lock(&dev_base_lock); 611 rcu_read_lock();
611 for_each_netdev(&init_net, dev) { 612 for_each_netdev_rcu(&init_net, dev) {
612 dn_db = dev->dn_ptr; 613 dn_db = dev->dn_ptr;
613 if (dn_db == NULL) 614 if (dn_db == NULL)
614 continue; 615 continue;
@@ -619,7 +620,7 @@ static void dn_fib_del_ifaddr(struct dn_ifaddr *ifa)
619 } 620 }
620 } 621 }
621 } 622 }
622 read_unlock(&dev_base_lock); 623 rcu_read_unlock();
623 624
624 if (found_it == 0) { 625 if (found_it == 0) {
625 fib_magic(RTM_DELROUTE, RTN_LOCAL, ifa->ifa_local, 16, ifa); 626 fib_magic(RTM_DELROUTE, RTN_LOCAL, ifa->ifa_local, 16, ifa);