Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172126
b: refs/heads/master
c: d79d792
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman authored and David S. Miller committed Dec 3, 2009
1 parent 54b4410 commit b5bfeac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 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: 04dc7f6be3a7b308f8545bb45772c9fb75f71aca
refs/heads/master: d79d792ef9f99cca463b6619a93e860d1c833a6e
1 change: 1 addition & 0 deletions trunk/include/net/netns/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ struct netns_xfrm {
struct work_struct policy_hash_work;

struct sock *nlsk;
struct sock *nlsk_stash;

u32 sysctl_aevent_etime;
u32 sysctl_aevent_rseqth;
Expand Down
18 changes: 10 additions & 8 deletions trunk/net/xfrm/xfrm_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -2721,22 +2721,24 @@ static int __net_init xfrm_user_net_init(struct net *net)
xfrm_netlink_rcv, NULL, THIS_MODULE);
if (nlsk == NULL)
return -ENOMEM;
net->xfrm.nlsk_stash = nlsk; /* Don't set to NULL */
rcu_assign_pointer(net->xfrm.nlsk, nlsk);
return 0;
}

static void __net_exit xfrm_user_net_exit(struct net *net)
static void __net_exit xfrm_user_net_exit(struct list_head *net_exit_list)
{
struct sock *nlsk = net->xfrm.nlsk;

rcu_assign_pointer(net->xfrm.nlsk, NULL);
synchronize_rcu();
netlink_kernel_release(nlsk);
struct net *net;
list_for_each_entry(net, net_exit_list, exit_list)
rcu_assign_pointer(net->xfrm.nlsk, NULL);
synchronize_net();
list_for_each_entry(net, net_exit_list, exit_list)
netlink_kernel_release(net->xfrm.nlsk_stash);
}

static struct pernet_operations xfrm_user_net_ops = {
.init = xfrm_user_net_init,
.exit = xfrm_user_net_exit,
.init = xfrm_user_net_init,
.exit_batch = xfrm_user_net_exit,
};

static int __init xfrm_user_init(void)
Expand Down

0 comments on commit b5bfeac

Please sign in to comment.