Commit 0368309c authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso Committed by David S. Miller

[NETFILTER]: ctnetlink: ctnetlink_event cleanup

Cleanup: Use 'else if' instead of a ugly 'goto' statement.
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 47116eb2
...@@ -312,29 +312,22 @@ static int ctnetlink_conntrack_event(struct notifier_block *this, ...@@ -312,29 +312,22 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
if (events & IPCT_DESTROY) { if (events & IPCT_DESTROY) {
type = IPCTNL_MSG_CT_DELETE; type = IPCTNL_MSG_CT_DELETE;
group = NFNLGRP_CONNTRACK_DESTROY; group = NFNLGRP_CONNTRACK_DESTROY;
goto alloc_skb; } else if (events & (IPCT_NEW | IPCT_RELATED)) {
}
if (events & (IPCT_NEW | IPCT_RELATED)) {
type = IPCTNL_MSG_CT_NEW; type = IPCTNL_MSG_CT_NEW;
flags = NLM_F_CREATE|NLM_F_EXCL; flags = NLM_F_CREATE|NLM_F_EXCL;
/* dump everything */ /* dump everything */
events = ~0UL; events = ~0UL;
group = NFNLGRP_CONNTRACK_NEW; group = NFNLGRP_CONNTRACK_NEW;
goto alloc_skb; } else if (events & (IPCT_STATUS |
}
if (events & (IPCT_STATUS |
IPCT_PROTOINFO | IPCT_PROTOINFO |
IPCT_HELPER | IPCT_HELPER |
IPCT_HELPINFO | IPCT_HELPINFO |
IPCT_NATINFO)) { IPCT_NATINFO)) {
type = IPCTNL_MSG_CT_NEW; type = IPCTNL_MSG_CT_NEW;
group = NFNLGRP_CONNTRACK_UPDATE; group = NFNLGRP_CONNTRACK_UPDATE;
goto alloc_skb; } else
}
return NOTIFY_DONE; return NOTIFY_DONE;
alloc_skb:
/* FIXME: Check if there are any listeners before, don't hurt performance */ /* FIXME: Check if there are any listeners before, don't hurt performance */
skb = alloc_skb(NLMSG_GOODSIZE, GFP_ATOMIC); skb = alloc_skb(NLMSG_GOODSIZE, GFP_ATOMIC);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment