Переглянути джерело

[NET]: Add a network namespace tag to struct net_device

Please note that network devices do not increase the count
count on the network namespace.  The are inside the network
namespace and so the network namespace tag is in the nature
of a back pointer and so getting and putting the network namespace
is unnecessary.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Eric W. Biederman 17 роки тому
батько
коміт
4a1c537113
1 змінених файлів з 4 додано та 0 видалено
  1. 4 0
      include/linux/netdevice.h

+ 4 - 0
include/linux/netdevice.h

@@ -41,6 +41,7 @@
 #include <linux/dmaengine.h>
 #include <linux/dmaengine.h>
 #include <linux/workqueue.h>
 #include <linux/workqueue.h>
 
 
+struct net;
 struct vlan_group;
 struct vlan_group;
 struct ethtool_ops;
 struct ethtool_ops;
 struct netpoll_info;
 struct netpoll_info;
@@ -663,6 +664,9 @@ struct net_device
 	void                    (*poll_controller)(struct net_device *dev);
 	void                    (*poll_controller)(struct net_device *dev);
 #endif
 #endif
 
 
+	/* Network namespace this network device is inside */
+	struct net		*nd_net;
+
 	/* bridge stuff */
 	/* bridge stuff */
 	struct net_bridge_port	*br_port;
 	struct net_bridge_port	*br_port;
 	/* macvlan */
 	/* macvlan */