aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2005-08-14 22:29:52 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 19:00:54 -0400
commitac6d439d2097b72ea0cbc2322ce1263a38bc1fd0 (patch)
tree19e638a226993dddede5a2da577e2572f7555a95 /net/ipv4
parentd629b836d151d43332492651dd841d32e57ebe3b (diff)
[NETLINK]: Convert netlink users to use group numbers instead of bitmasks
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/devinet.c7
-rw-r--r--net/ipv4/fib_frontend.c2
-rw-r--r--net/ipv4/fib_semantics.c4
-rw-r--r--net/ipv4/netfilter/ip_conntrack_netlink.c12
-rw-r--r--net/ipv4/netfilter/ipt_ULOG.c8
5 files changed, 16 insertions, 17 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index d8a10e3dd77d..ba2895ae8151 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1111,13 +1111,12 @@ static void rtmsg_ifa(int event, struct in_ifaddr* ifa)
1111 struct sk_buff *skb = alloc_skb(size, GFP_KERNEL); 1111 struct sk_buff *skb = alloc_skb(size, GFP_KERNEL);
1112 1112
1113 if (!skb) 1113 if (!skb)
1114 netlink_set_err(rtnl, 0, RTMGRP_IPV4_IFADDR, ENOBUFS); 1114 netlink_set_err(rtnl, 0, RTNLGRP_IPV4_IFADDR, ENOBUFS);
1115 else if (inet_fill_ifaddr(skb, ifa, current->pid, 0, event, 0) < 0) { 1115 else if (inet_fill_ifaddr(skb, ifa, current->pid, 0, event, 0) < 0) {
1116 kfree_skb(skb); 1116 kfree_skb(skb);
1117 netlink_set_err(rtnl, 0, RTMGRP_IPV4_IFADDR, EINVAL); 1117 netlink_set_err(rtnl, 0, RTNLGRP_IPV4_IFADDR, EINVAL);
1118 } else { 1118 } else {
1119 NETLINK_CB(skb).dst_groups = RTMGRP_IPV4_IFADDR; 1119 netlink_broadcast(rtnl, skb, 0, RTNLGRP_IPV4_IFADDR, GFP_KERNEL);
1120 netlink_broadcast(rtnl, skb, 0, RTMGRP_IPV4_IFADDR, GFP_KERNEL);
1121 } 1120 }
1122} 1121}
1123 1122
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 75d03e37b9a8..d4e7b578a25d 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -560,7 +560,7 @@ static void nl_fib_input(struct sock *sk, int len)
560 pid = nlh->nlmsg_pid; /*pid of sending process */ 560 pid = nlh->nlmsg_pid; /*pid of sending process */
561 NETLINK_CB(skb).pid = 0; /* from kernel */ 561 NETLINK_CB(skb).pid = 0; /* from kernel */
562 NETLINK_CB(skb).dst_pid = pid; 562 NETLINK_CB(skb).dst_pid = pid;
563 NETLINK_CB(skb).dst_groups = 0; /* unicast */ 563 NETLINK_CB(skb).dst_group = 0; /* unicast */
564 netlink_unicast(sk, skb, pid, MSG_DONTWAIT); 564 netlink_unicast(sk, skb, pid, MSG_DONTWAIT);
565} 565}
566 566
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index e278cb9d0075..7e4651b3caa8 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -290,10 +290,10 @@ void rtmsg_fib(int event, u32 key, struct fib_alias *fa,
290 kfree_skb(skb); 290 kfree_skb(skb);
291 return; 291 return;
292 } 292 }
293 NETLINK_CB(skb).dst_groups = RTMGRP_IPV4_ROUTE; 293 NETLINK_CB(skb).dst_group = RTNLGRP_IPV4_ROUTE;
294 if (n->nlmsg_flags&NLM_F_ECHO) 294 if (n->nlmsg_flags&NLM_F_ECHO)
295 atomic_inc(&skb->users); 295 atomic_inc(&skb->users);
296 netlink_broadcast(rtnl, skb, pid, RTMGRP_IPV4_ROUTE, GFP_KERNEL); 296 netlink_broadcast(rtnl, skb, pid, RTNLGRP_IPV4_ROUTE, GFP_KERNEL);
297 if (n->nlmsg_flags&NLM_F_ECHO) 297 if (n->nlmsg_flags&NLM_F_ECHO)
298 netlink_unicast(rtnl, skb, pid, MSG_DONTWAIT); 298 netlink_unicast(rtnl, skb, pid, MSG_DONTWAIT);
299} 299}
diff --git a/net/ipv4/netfilter/ip_conntrack_netlink.c b/net/ipv4/netfilter/ip_conntrack_netlink.c
index 1221a9c8bac2..a4e9278db4ed 100644
--- a/net/ipv4/netfilter/ip_conntrack_netlink.c
+++ b/net/ipv4/netfilter/ip_conntrack_netlink.c
@@ -297,7 +297,7 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
297 struct sk_buff *skb; 297 struct sk_buff *skb;
298 unsigned int type; 298 unsigned int type;
299 unsigned char *b; 299 unsigned char *b;
300 unsigned int flags = 0, groups; 300 unsigned int flags = 0, group;
301 301
302 /* ignore our fake conntrack entry */ 302 /* ignore our fake conntrack entry */
303 if (ct == &ip_conntrack_untracked) 303 if (ct == &ip_conntrack_untracked)
@@ -305,7 +305,7 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
305 305
306 if (events & IPCT_DESTROY) { 306 if (events & IPCT_DESTROY) {
307 type = IPCTNL_MSG_CT_DELETE; 307 type = IPCTNL_MSG_CT_DELETE;
308 groups = NF_NETLINK_CONNTRACK_DESTROY; 308 group = NFNLGRP_CONNTRACK_DESTROY;
309 goto alloc_skb; 309 goto alloc_skb;
310 } 310 }
311 if (events & (IPCT_NEW | IPCT_RELATED)) { 311 if (events & (IPCT_NEW | IPCT_RELATED)) {
@@ -313,7 +313,7 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
313 flags = NLM_F_CREATE|NLM_F_EXCL; 313 flags = NLM_F_CREATE|NLM_F_EXCL;
314 /* dump everything */ 314 /* dump everything */
315 events = ~0UL; 315 events = ~0UL;
316 groups = NF_NETLINK_CONNTRACK_NEW; 316 group = NFNLGRP_CONNTRACK_NEW;
317 goto alloc_skb; 317 goto alloc_skb;
318 } 318 }
319 if (events & (IPCT_STATUS | 319 if (events & (IPCT_STATUS |
@@ -322,7 +322,7 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
322 IPCT_HELPINFO | 322 IPCT_HELPINFO |
323 IPCT_NATINFO)) { 323 IPCT_NATINFO)) {
324 type = IPCTNL_MSG_CT_NEW; 324 type = IPCTNL_MSG_CT_NEW;
325 groups = NF_NETLINK_CONNTRACK_UPDATE; 325 group = NFNLGRP_CONNTRACK_UPDATE;
326 goto alloc_skb; 326 goto alloc_skb;
327 } 327 }
328 328
@@ -375,7 +375,7 @@ alloc_skb:
375 goto nfattr_failure; 375 goto nfattr_failure;
376 376
377 nlh->nlmsg_len = skb->tail - b; 377 nlh->nlmsg_len = skb->tail - b;
378 nfnetlink_send(skb, 0, groups, 0); 378 nfnetlink_send(skb, 0, group, 0);
379 return NOTIFY_DONE; 379 return NOTIFY_DONE;
380 380
381nlmsg_failure: 381nlmsg_failure:
@@ -1194,7 +1194,7 @@ static int ctnetlink_expect_event(struct notifier_block *this,
1194 1194
1195 nlh->nlmsg_len = skb->tail - b; 1195 nlh->nlmsg_len = skb->tail - b;
1196 proto = exp->tuple.dst.protonum; 1196 proto = exp->tuple.dst.protonum;
1197 nfnetlink_send(skb, 0, NF_NETLINK_CONNTRACK_EXP_NEW, 0); 1197 nfnetlink_send(skb, 0, NFNLGRP_CONNTRACK_EXP_NEW, 0);
1198 return NOTIFY_DONE; 1198 return NOTIFY_DONE;
1199 1199
1200nlmsg_failure: 1200nlmsg_failure:
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c
index 1d8ac4595e17..89816b83455e 100644
--- a/net/ipv4/netfilter/ipt_ULOG.c
+++ b/net/ipv4/netfilter/ipt_ULOG.c
@@ -116,10 +116,10 @@ static void ulog_send(unsigned int nlgroupnum)
116 if (ub->qlen > 1) 116 if (ub->qlen > 1)
117 ub->lastnlh->nlmsg_type = NLMSG_DONE; 117 ub->lastnlh->nlmsg_type = NLMSG_DONE;
118 118
119 NETLINK_CB(ub->skb).dst_groups = (1 << nlgroupnum); 119 NETLINK_CB(ub->skb).dst_group = nlgroupnum + 1;
120 DEBUGP("ipt_ULOG: throwing %d packets to netlink mask %u\n", 120 DEBUGP("ipt_ULOG: throwing %d packets to netlink group %u\n",
121 ub->qlen, nlgroupnum); 121 ub->qlen, nlgroupnum + 1);
122 netlink_broadcast(nflognl, ub->skb, 0, (1 << nlgroupnum), GFP_ATOMIC); 122 netlink_broadcast(nflognl, ub->skb, 0, nlgroupnum + 1, GFP_ATOMIC);
123 123
124 ub->qlen = 0; 124 ub->qlen = 0;
125 ub->skb = NULL; 125 ub->skb = NULL;