Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210249
b: refs/heads/master
c: b963ea8
h: refs/heads/master
i:
  210247: f6b34d8
v: v3
  • Loading branch information
David S. Miller committed Aug 31, 2010
1 parent 8a1e2e6 commit dd22e2a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 628e300cccaa628d8fb92aa28cb7530a3d5f2257
refs/heads/master: b963ea89f00f13c648af4082e5efb2172d369727
22 changes: 22 additions & 0 deletions trunk/net/netlink/af_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2102,6 +2102,26 @@ static void __net_exit netlink_net_exit(struct net *net)
#endif
}

static void __init netlink_add_usersock_entry(void)
{
unsigned long *listeners;
int groups = 32;

listeners = kzalloc(NLGRPSZ(groups) + sizeof(struct listeners_rcu_head),
GFP_KERNEL);
if (!listeners)
panic("netlink_add_usersock_entry: Cannot allocate listneres\n");

netlink_table_grab();

nl_table[NETLINK_USERSOCK].groups = groups;
nl_table[NETLINK_USERSOCK].listeners = listeners;
nl_table[NETLINK_USERSOCK].module = THIS_MODULE;
nl_table[NETLINK_USERSOCK].registered = 1;

netlink_table_ungrab();
}

static struct pernet_operations __net_initdata netlink_net_ops = {
.init = netlink_net_init,
.exit = netlink_net_exit,
Expand Down Expand Up @@ -2150,6 +2170,8 @@ static int __init netlink_proto_init(void)
hash->rehash_time = jiffies;
}

netlink_add_usersock_entry();

sock_register(&netlink_family_ops);
register_pernet_subsys(&netlink_net_ops);
/* The netlink device handler may be needed early. */
Expand Down

0 comments on commit dd22e2a

Please sign in to comment.