aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2007-09-12 07:53:49 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:49:12 -0400
commitce286d327341295f58d89864d746a524287cfdf9 (patch)
treeee7241e7504333cc4cf647ede551248268f865c4 /include/linux/netdevice.h
parentb267b179648e46ea8e2a44f7314a23eb6aee1d6c (diff)
[NET]: Implement network device movement between namespaces
This patch introduces NETIF_F_NETNS_LOCAL a flag to indicate a network device is local to a single network namespace and should never be moved. Useful for pseudo devices that we need an instance in each network namespace (like the loopback device) and for any device we find that cannot handle multiple network namespaces so we may trap them in the initial network namespace. This patch introduces the function dev_change_net_namespace a function used to move a network device from one network namespace to another. To the network device nothing special appears to happen, to the components of the network stack it appears as if the network device was unregistered in the network namespace it is in, and a new device was registered in the network namespace the device was moved to. This patch sets up a namespace device destructor that upon the exit of a network namespace moves all of the movable network devices to the initial network namespace so they are not lost. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 7353b3e1f4fc..407658c64fb6 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -449,6 +449,7 @@ struct net_device
449#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ 449#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */
450#define NETIF_F_GSO 2048 /* Enable software GSO. */ 450#define NETIF_F_GSO 2048 /* Enable software GSO. */
451#define NETIF_F_LLTX 4096 /* LockLess TX */ 451#define NETIF_F_LLTX 4096 /* LockLess TX */
452#define NETIF_F_NETNS_LOCAL 8192 /* Does not change network namespaces */
452#define NETIF_F_MULTI_QUEUE 16384 /* Has multiple TX/RX queues */ 453#define NETIF_F_MULTI_QUEUE 16384 /* Has multiple TX/RX queues */
453#define NETIF_F_LRO 32768 /* large receive offload */ 454#define NETIF_F_LRO 32768 /* large receive offload */
454 455
@@ -1016,6 +1017,8 @@ extern int dev_ethtool(struct net *net, struct ifreq *);
1016extern unsigned dev_get_flags(const struct net_device *); 1017extern unsigned dev_get_flags(const struct net_device *);
1017extern int dev_change_flags(struct net_device *, unsigned); 1018extern int dev_change_flags(struct net_device *, unsigned);
1018extern int dev_change_name(struct net_device *, char *); 1019extern int dev_change_name(struct net_device *, char *);
1020extern int dev_change_net_namespace(struct net_device *,
1021 struct net *, const char *);
1019extern int dev_set_mtu(struct net_device *, int); 1022extern int dev_set_mtu(struct net_device *, int);
1020extern int dev_set_mac_address(struct net_device *, 1023extern int dev_set_mac_address(struct net_device *,
1021 struct sockaddr *); 1024 struct sockaddr *);