diff options
author | Denis V. Lunev <den@openvz.org> | 2008-04-16 05:02:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-16 05:02:18 -0400 |
commit | f3005d7f4abe03ad41af33b1548602cd086d86a2 (patch) | |
tree | 937c5b6ba6089f93fa4f0a11a37ab07a8564e398 /include/linux/netdevice.h | |
parent | 3661a910836a509be65afc3c1e512d900e1280f9 (diff) |
[NETNS]: Add netns refcnt debug for network devices.
dev_set_net is called for
- just allocated devices
- devices moving from one namespace to another
release_net has proper check inside to distinguish these cases.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 8b17ed40dea2..7c1d4466583b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -758,7 +758,8 @@ static inline | |||
758 | void dev_net_set(struct net_device *dev, struct net *net) | 758 | void dev_net_set(struct net_device *dev, struct net *net) |
759 | { | 759 | { |
760 | #ifdef CONFIG_NET_NS | 760 | #ifdef CONFIG_NET_NS |
761 | dev->nd_net = net; | 761 | release_net(dev->nd_net); |
762 | dev->nd_net = hold_net(net); | ||
762 | #endif | 763 | #endif |
763 | } | 764 | } |
764 | 765 | ||