aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/devinet.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/devinet.c')
-rw-r--r--net/ipv4/devinet.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index e381edb19b2..21f71bf912d 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -409,12 +409,12 @@ static int inet_set_ifa(struct net_device *dev, struct in_ifaddr *ifa)
409 return inet_insert_ifa(ifa); 409 return inet_insert_ifa(ifa);
410} 410}
411 411
412struct in_device *inetdev_by_index(int ifindex) 412struct in_device *inetdev_by_index(struct net *net, int ifindex)
413{ 413{
414 struct net_device *dev; 414 struct net_device *dev;
415 struct in_device *in_dev = NULL; 415 struct in_device *in_dev = NULL;
416 read_lock(&dev_base_lock); 416 read_lock(&dev_base_lock);
417 dev = __dev_get_by_index(&init_net, ifindex); 417 dev = __dev_get_by_index(net, ifindex);
418 if (dev) 418 if (dev)
419 in_dev = in_dev_get(dev); 419 in_dev = in_dev_get(dev);
420 read_unlock(&dev_base_lock); 420 read_unlock(&dev_base_lock);
@@ -454,7 +454,7 @@ static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg
454 goto errout; 454 goto errout;
455 455
456 ifm = nlmsg_data(nlh); 456 ifm = nlmsg_data(nlh);
457 in_dev = inetdev_by_index(ifm->ifa_index); 457 in_dev = inetdev_by_index(net, ifm->ifa_index);
458 if (in_dev == NULL) { 458 if (in_dev == NULL) {
459 err = -ENODEV; 459 err = -ENODEV;
460 goto errout; 460 goto errout;