diff options
author | Denis V. Lunev <den@openvz.org> | 2008-01-21 20:32:38 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:10:20 -0500 |
commit | 7fee0ca23711ce1a6b13d3ab78915809a72a59ec (patch) | |
tree | e2df8e3997d996749b5169df59a56f3df67158c5 /net/ipv4/devinet.c | |
parent | da0e28cb68a7e22b47c6ae1a5b12cb538c13c69f (diff) |
[NETNS]: Add netns parameter to inetdev_by_index.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/devinet.c')
-rw-r--r-- | net/ipv4/devinet.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index e381edb19b23..21f71bf912d5 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 | ||
412 | struct in_device *inetdev_by_index(int ifindex) | 412 | struct 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; |