diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-01-30 07:23:03 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-03 23:20:32 -0500 |
commit | 8a83a00b0735190384a348156837918271034144 (patch) | |
tree | f69d903405e2424c196d8648bb6cb18443359373 /include/linux | |
parent | 6884b348ed759184032306c9435a727741a72298 (diff) |
net: maintain namespace isolation between vlan and real device
In the vlan and macvlan drivers, the start_xmit function forwards
data to the dev_queue_xmit function for another device, which may
potentially belong to a different namespace.
To make sure that classification stays within a single namespace,
this resets the potentially critical fields.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/netdevice.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 93a32a5ca74f..622ba5aa93c4 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1004,6 +1004,15 @@ static inline bool netdev_uses_dsa_tags(struct net_device *dev) | |||
1004 | return 0; | 1004 | return 0; |
1005 | } | 1005 | } |
1006 | 1006 | ||
1007 | #ifndef CONFIG_NET_NS | ||
1008 | static inline void skb_set_dev(struct sk_buff *skb, struct net_device *dev) | ||
1009 | { | ||
1010 | skb->dev = dev; | ||
1011 | } | ||
1012 | #else /* CONFIG_NET_NS */ | ||
1013 | void skb_set_dev(struct sk_buff *skb, struct net_device *dev); | ||
1014 | #endif | ||
1015 | |||
1007 | static inline bool netdev_uses_trailer_tags(struct net_device *dev) | 1016 | static inline bool netdev_uses_trailer_tags(struct net_device *dev) |
1008 | { | 1017 | { |
1009 | #ifdef CONFIG_NET_DSA_TAG_TRAILER | 1018 | #ifdef CONFIG_NET_DSA_TAG_TRAILER |