]> git.baikalelectronics.ru Git - kernel.git/commit
vxlan: correctly set vxlan->net when creating the device in a netns
authorSabrina Dubroca <sd@queasysnail.net>
Fri, 30 Jun 2017 13:50:00 +0000 (15:50 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Jul 2017 09:04:10 +0000 (02:04 -0700)
commit06d3ac10c6b87fd136880a7418950f19c49e826a
treefd6c8a68042e13acbc1abedd16e09fb32f1fbcc9
parentd54105e68ae6e40b6fb52d9ed249dbeba113191c
vxlan: correctly set vxlan->net when creating the device in a netns

Commit 00553929ae45 ("vxlan: refactor verification and application of
configuration") modified vxlan device creation, and replaced the
assignment of vxlan->net to src_net with dev_net(netdev) in ->setup().

But dev_net(netdev) is not the same as src_net. At the time ->setup()
is called, dev_net hasn't been set yet, so we end up creating the
socket for the vxlan device in init_net.

Fix this by bringing back the assignment of vxlan->net during device
creation.

Fixes: 00553929ae45 ("vxlan: refactor verification and application of configuration")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Matthias Schiffer <mschiffer@universe-factory.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan.c