diff options
author | stephen hemminger <shemminger@vyatta.com> | 2012-10-01 20:49:21 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-10-02 20:38:04 +0200 |
commit | bfe1b9b16e3bed06d16826813edf5922fd82d91f (patch) | |
tree | 4be855263ce4ef237a93c3b0971de26c69b36746 /drivers/net/vxlan.c | |
parent | vxlan: Depend on CONFIG_INET (diff) | |
download | linux-bfe1b9b16e3bed06d16826813edf5922fd82d91f.tar.xz linux-bfe1b9b16e3bed06d16826813edf5922fd82d91f.zip |
vxlan: put UDP socket in correct namespace
Move vxlan UDP socket to correct network namespace
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxlan.c')
-rw-r--r-- | drivers/net/vxlan.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index f87a98f1aec2..51de9edb55f5 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -1136,6 +1136,9 @@ static __net_init int vxlan_init_net(struct net *net) pr_debug("UDP socket create failed\n"); return rc; } + /* Put in proper namespace */ + sk = vn->sock->sk; + sk_change_net(sk, net); vxlan_addr.sin_port = htons(vxlan_port); @@ -1144,13 +1147,12 @@ static __net_init int vxlan_init_net(struct net *net) if (rc < 0) { pr_debug("bind for UDP socket %pI4:%u (%d)\n", &vxlan_addr.sin_addr, ntohs(vxlan_addr.sin_port), rc); - sock_release(vn->sock); + sk_release_kernel(sk); vn->sock = NULL; return rc; } /* Disable multicast loopback */ - sk = vn->sock->sk; inet_sk(sk)->mc_loop = 0; /* Mark socket as an encapsulation socket. */ @@ -1169,7 +1171,7 @@ static __net_exit void vxlan_exit_net(struct net *net) struct vxlan_net *vn = net_generic(net, vxlan_net_id); if (vn->sock) { - sock_release(vn->sock); + sk_release_kernel(vn->sock->sk); vn->sock = NULL; } } |