aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2005-08-15 15:33:26 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 19:01:11 -0400
commit066286071d3542243baa68166acb779187c848b3 (patch)
treeef6604f16ceb13842a30311654e6a64aac716c48 /net
parent9a4595bc7e67962f13232ee55a64e063062c3a99 (diff)
[NETLINK]: Add "groups" argument to netlink_kernel_create
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/bridge/netfilter/ebt_ulog.c3
-rw-r--r--net/core/rtnetlink.c3
-rw-r--r--net/decnet/netfilter/dn_rtmsg.c4
-rw-r--r--net/ipv4/fib_frontend.c2
-rw-r--r--net/ipv4/inet_diag.c2
-rw-r--r--net/ipv4/netfilter/ip_queue.c2
-rw-r--r--net/ipv4/netfilter/ipt_ULOG.c3
-rw-r--r--net/ipv6/netfilter/ip6_queue.c3
-rw-r--r--net/netfilter/nfnetlink.c4
-rw-r--r--net/netlink/af_netlink.c6
-rw-r--r--net/xfrm/xfrm_user.c4
11 files changed, 21 insertions, 15 deletions
diff --git a/net/bridge/netfilter/ebt_ulog.c b/net/bridge/netfilter/ebt_ulog.c
index 6845b5dd6d77..aae26ae2e61f 100644
--- a/net/bridge/netfilter/ebt_ulog.c
+++ b/net/bridge/netfilter/ebt_ulog.c
@@ -258,7 +258,8 @@ static int __init init(void)
258 spin_lock_init(&ulog_buffers[i].lock); 258 spin_lock_init(&ulog_buffers[i].lock);
259 } 259 }
260 260
261 ebtulognl = netlink_kernel_create(NETLINK_NFLOG, NULL, THIS_MODULE); 261 ebtulognl = netlink_kernel_create(NETLINK_NFLOG, EBT_ULOG_MAXNLGROUPS,
262 NULL, THIS_MODULE);
262 if (!ebtulognl) 263 if (!ebtulognl)
263 ret = -ENOMEM; 264 ret = -ENOMEM;
264 else if ((ret = ebt_register_watcher(&ulog))) 265 else if ((ret = ebt_register_watcher(&ulog)))
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 5f3f95b5585d..9bed7569ce3f 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -708,7 +708,8 @@ void __init rtnetlink_init(void)
708 if (!rta_buf) 708 if (!rta_buf)
709 panic("rtnetlink_init: cannot allocate rta_buf\n"); 709 panic("rtnetlink_init: cannot allocate rta_buf\n");
710 710
711 rtnl = netlink_kernel_create(NETLINK_ROUTE, rtnetlink_rcv, THIS_MODULE); 711 rtnl = netlink_kernel_create(NETLINK_ROUTE, RTNLGRP_MAX, rtnetlink_rcv,
712 THIS_MODULE);
712 if (rtnl == NULL) 713 if (rtnl == NULL)
713 panic("rtnetlink_init: cannot initialize rtnetlink\n"); 714 panic("rtnetlink_init: cannot initialize rtnetlink\n");
714 netlink_set_nonroot(NETLINK_ROUTE, NL_NONROOT_RECV); 715 netlink_set_nonroot(NETLINK_ROUTE, NL_NONROOT_RECV);
diff --git a/net/decnet/netfilter/dn_rtmsg.c b/net/decnet/netfilter/dn_rtmsg.c
index 353fed6888f9..afb33a25ea55 100644
--- a/net/decnet/netfilter/dn_rtmsg.c
+++ b/net/decnet/netfilter/dn_rtmsg.c
@@ -138,8 +138,8 @@ static int __init init(void)
138{ 138{
139 int rv = 0; 139 int rv = 0;
140 140
141 dnrmg = netlink_kernel_create(NETLINK_DNRTMSG, dnrmg_receive_user_sk, 141 dnrmg = netlink_kernel_create(NETLINK_DNRTMSG, DNRNG_NLGRP_MAX,
142 THIS_MODULE); 142 dnrmg_receive_user_sk, THIS_MODULE);
143 if (dnrmg == NULL) { 143 if (dnrmg == NULL) {
144 printk(KERN_ERR "dn_rtmsg: Cannot create netlink socket"); 144 printk(KERN_ERR "dn_rtmsg: Cannot create netlink socket");
145 return -ENOMEM; 145 return -ENOMEM;
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index d4e7b578a25d..4e1379f71269 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -566,7 +566,7 @@ static void nl_fib_input(struct sock *sk, int len)
566 566
567static void nl_fib_lookup_init(void) 567static void nl_fib_lookup_init(void)
568{ 568{
569 netlink_kernel_create(NETLINK_FIB_LOOKUP, nl_fib_input, THIS_MODULE); 569 netlink_kernel_create(NETLINK_FIB_LOOKUP, 0, nl_fib_input, THIS_MODULE);
570} 570}
571 571
572static void fib_disable_ip(struct net_device *dev, int force) 572static void fib_disable_ip(struct net_device *dev, int force)
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 1880ad8575d8..71f3c7350c6e 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -845,7 +845,7 @@ static int __init inet_diag_init(void)
845 goto out; 845 goto out;
846 846
847 memset(inet_diag_table, 0, inet_diag_table_size); 847 memset(inet_diag_table, 0, inet_diag_table_size);
848 idiagnl = netlink_kernel_create(NETLINK_INET_DIAG, inet_diag_rcv, 848 idiagnl = netlink_kernel_create(NETLINK_INET_DIAG, 0, inet_diag_rcv,
849 THIS_MODULE); 849 THIS_MODULE);
850 if (idiagnl == NULL) 850 if (idiagnl == NULL)
851 goto out_free_table; 851 goto out_free_table;
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
index 7f2bcc7198fa..d54f14d926f6 100644
--- a/net/ipv4/netfilter/ip_queue.c
+++ b/net/ipv4/netfilter/ip_queue.c
@@ -671,7 +671,7 @@ init_or_cleanup(int init)
671 goto cleanup; 671 goto cleanup;
672 672
673 netlink_register_notifier(&ipq_nl_notifier); 673 netlink_register_notifier(&ipq_nl_notifier);
674 ipqnl = netlink_kernel_create(NETLINK_FIREWALL, ipq_rcv_sk, 674 ipqnl = netlink_kernel_create(NETLINK_FIREWALL, 0, ipq_rcv_sk,
675 THIS_MODULE); 675 THIS_MODULE);
676 if (ipqnl == NULL) { 676 if (ipqnl == NULL) {
677 printk(KERN_ERR "ip_queue: failed to create netlink socket\n"); 677 printk(KERN_ERR "ip_queue: failed to create netlink socket\n");
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c
index 89816b83455e..e2c14f3cb2fc 100644
--- a/net/ipv4/netfilter/ipt_ULOG.c
+++ b/net/ipv4/netfilter/ipt_ULOG.c
@@ -388,7 +388,8 @@ static int __init init(void)
388 ulog_buffers[i].timer.data = i; 388 ulog_buffers[i].timer.data = i;
389 } 389 }
390 390
391 nflognl = netlink_kernel_create(NETLINK_NFLOG, NULL, THIS_MODULE); 391 nflognl = netlink_kernel_create(NETLINK_NFLOG, ULOG_MAXNLGROUPS, NULL,
392 THIS_MODULE);
392 if (!nflognl) 393 if (!nflognl)
393 return -ENOMEM; 394 return -ENOMEM;
394 395
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
index 446764545b10..aa11cf366efa 100644
--- a/net/ipv6/netfilter/ip6_queue.c
+++ b/net/ipv6/netfilter/ip6_queue.c
@@ -667,7 +667,8 @@ init_or_cleanup(int init)
667 goto cleanup; 667 goto cleanup;
668 668
669 netlink_register_notifier(&ipq_nl_notifier); 669 netlink_register_notifier(&ipq_nl_notifier);
670 ipqnl = netlink_kernel_create(NETLINK_IP6_FW, ipq_rcv_sk, THIS_MODULE); 670 ipqnl = netlink_kernel_create(NETLINK_IP6_FW, 0, ipq_rcv_sk,
671 THIS_MODULE);
671 if (ipqnl == NULL) { 672 if (ipqnl == NULL) {
672 printk(KERN_ERR "ip6_queue: failed to create netlink socket\n"); 673 printk(KERN_ERR "ip6_queue: failed to create netlink socket\n");
673 goto cleanup_netlink_notifier; 674 goto cleanup_netlink_notifier;
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
index 36a4c5fbb7d7..e089f17bb803 100644
--- a/net/netfilter/nfnetlink.c
+++ b/net/netfilter/nfnetlink.c
@@ -355,8 +355,8 @@ int __init nfnetlink_init(void)
355{ 355{
356 printk("Netfilter messages via NETLINK v%s.\n", nfversion); 356 printk("Netfilter messages via NETLINK v%s.\n", nfversion);
357 357
358 nfnl = netlink_kernel_create(NETLINK_NETFILTER, nfnetlink_rcv, 358 nfnl = netlink_kernel_create(NETLINK_NETFILTER, NFNLGRP_MAX,
359 THIS_MODULE); 359 nfnetlink_rcv, THIS_MODULE);
360 if (!nfnl) { 360 if (!nfnl) {
361 printk(KERN_ERR "cannot initialize nfnetlink!\n"); 361 printk(KERN_ERR "cannot initialize nfnetlink!\n");
362 return -1; 362 return -1;
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 47e791738014..e259f46e26f7 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1204,7 +1204,9 @@ static void netlink_data_ready(struct sock *sk, int len)
1204 */ 1204 */
1205 1205
1206struct sock * 1206struct sock *
1207netlink_kernel_create(int unit, void (*input)(struct sock *sk, int len), struct module *module) 1207netlink_kernel_create(int unit, unsigned int groups,
1208 void (*input)(struct sock *sk, int len),
1209 struct module *module)
1208{ 1210{
1209 struct socket *sock; 1211 struct socket *sock;
1210 struct sock *sk; 1212 struct sock *sk;
@@ -1234,7 +1236,7 @@ netlink_kernel_create(int unit, void (*input)(struct sock *sk, int len), struct
1234 nlk->flags |= NETLINK_KERNEL_SOCKET; 1236 nlk->flags |= NETLINK_KERNEL_SOCKET;
1235 1237
1236 netlink_table_grab(); 1238 netlink_table_grab();
1237 nl_table[unit].groups = 32; 1239 nl_table[unit].groups = groups < 32 ? 32 : groups;
1238 nl_table[unit].module = module; 1240 nl_table[unit].module = module;
1239 nl_table[unit].registered = 1; 1241 nl_table[unit].registered = 1;
1240 netlink_table_ungrab(); 1242 netlink_table_ungrab();
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 0579d209af27..c35336a0f71b 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -1520,8 +1520,8 @@ static int __init xfrm_user_init(void)
1520{ 1520{
1521 printk(KERN_INFO "Initializing IPsec netlink socket\n"); 1521 printk(KERN_INFO "Initializing IPsec netlink socket\n");
1522 1522
1523 xfrm_nl = netlink_kernel_create(NETLINK_XFRM, xfrm_netlink_rcv, 1523 xfrm_nl = netlink_kernel_create(NETLINK_XFRM, XFRMNLGRP_MAX,
1524 THIS_MODULE); 1524 xfrm_netlink_rcv, THIS_MODULE);
1525 if (xfrm_nl == NULL) 1525 if (xfrm_nl == NULL)
1526 return -ENOMEM; 1526 return -ENOMEM;
1527 1527