aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2006-01-05 15:18:08 -0500
committerDavid S. Miller <davem@davemloft.net>2006-01-05 15:18:08 -0500
commit0368309cb45bbba99f84a01d5fc6a18780788480 (patch)
tree4e49139b921d701b2fbf33d5e21016ee108a0ef1 /net/ipv4
parent47116eb201571ad1198a8d76dc3571e85ba7c8c9 (diff)
[NETFILTER]: ctnetlink: ctnetlink_event cleanup
Cleanup: Use 'else if' instead of a ugly 'goto' statement. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> 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/netfilter/ip_conntrack_netlink.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/net/ipv4/netfilter/ip_conntrack_netlink.c b/net/ipv4/netfilter/ip_conntrack_netlink.c
index faa027ba687e..04137d0c164c 100644
--- a/net/ipv4/netfilter/ip_conntrack_netlink.c
+++ b/net/ipv4/netfilter/ip_conntrack_netlink.c
@@ -312,29 +312,22 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
312 if (events & IPCT_DESTROY) { 312 if (events & IPCT_DESTROY) {
313 type = IPCTNL_MSG_CT_DELETE; 313 type = IPCTNL_MSG_CT_DELETE;
314 group = NFNLGRP_CONNTRACK_DESTROY; 314 group = NFNLGRP_CONNTRACK_DESTROY;
315 goto alloc_skb; 315 } else if (events & (IPCT_NEW | IPCT_RELATED)) {
316 }
317 if (events & (IPCT_NEW | IPCT_RELATED)) {
318 type = IPCTNL_MSG_CT_NEW; 316 type = IPCTNL_MSG_CT_NEW;
319 flags = NLM_F_CREATE|NLM_F_EXCL; 317 flags = NLM_F_CREATE|NLM_F_EXCL;
320 /* dump everything */ 318 /* dump everything */
321 events = ~0UL; 319 events = ~0UL;
322 group = NFNLGRP_CONNTRACK_NEW; 320 group = NFNLGRP_CONNTRACK_NEW;
323 goto alloc_skb; 321 } else if (events & (IPCT_STATUS |
324 }
325 if (events & (IPCT_STATUS |
326 IPCT_PROTOINFO | 322 IPCT_PROTOINFO |
327 IPCT_HELPER | 323 IPCT_HELPER |
328 IPCT_HELPINFO | 324 IPCT_HELPINFO |
329 IPCT_NATINFO)) { 325 IPCT_NATINFO)) {
330 type = IPCTNL_MSG_CT_NEW; 326 type = IPCTNL_MSG_CT_NEW;
331 group = NFNLGRP_CONNTRACK_UPDATE; 327 group = NFNLGRP_CONNTRACK_UPDATE;
332 goto alloc_skb; 328 } else
333 } 329 return NOTIFY_DONE;
334 330
335 return NOTIFY_DONE;
336
337alloc_skb:
338 /* FIXME: Check if there are any listeners before, don't hurt performance */ 331 /* FIXME: Check if there are any listeners before, don't hurt performance */
339 332
340 skb = alloc_skb(NLMSG_GOODSIZE, GFP_ATOMIC); 333 skb = alloc_skb(NLMSG_GOODSIZE, GFP_ATOMIC);