Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328429
b: refs/heads/master
c: bfe1b9b
h: refs/heads/master
i:
  328427: 630966b
v: v3
  • Loading branch information
stephen hemminger authored and David S. Miller committed Oct 2, 2012
1 parent f3cdaaf commit 57de384
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aaba1f58a73a285aefac825e5eafad1d211c43de
refs/heads/master: bfe1b9b16e3bed06d16826813edf5922fd82d91f
8 changes: 5 additions & 3 deletions trunk/drivers/net/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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. */
Expand All @@ -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;
}
}
Expand Down

0 comments on commit 57de384

Please sign in to comment.