]> git.baikalelectronics.ru Git - kernel.git/commit
vxlan: add x-netns support
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Thu, 24 Apr 2014 08:02:49 +0000 (10:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Apr 2014 20:18:26 +0000 (16:18 -0400)
commit599aaaf679ed60ee8ea2fa9ab9ef9fe551492e88
tree8fefd68d91d348f71b472b992021fefbb20add99
parent32fb17797dc9c85f087b7887ac84004a3d95b3b7
vxlan: add x-netns support

This patch allows to switch the netns when packet is encapsulated or
decapsulated.
The vxlan socket is openned into the i/o netns, ie into the netns where
encapsulated packets are received. The socket lookup is done into this netns to
find the corresponding vxlan tunnel. After decapsulation, the packet is
injecting into the corresponding interface which may stand to another netns.

When one of the two netns is removed, the tunnel is destroyed.

Configuration example:
ip netns add netns1
ip netns exec netns1 ip link set lo up
ip link add vxlan10 type vxlan id 10 group 239.0.0.10 dev eth0 dstport 0
ip link set vxlan10 netns netns1
ip netns exec netns1 ip addr add 192.168.0.249/24 broadcast 192.168.0.255 dev vxlan10
ip netns exec netns1 ip link set vxlan10 up

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan.c
include/net/vxlan.h
net/openvswitch/vport-vxlan.c