diff options
author | Patrick McHardy <kaber@trash.net> | 2006-03-20 18:03:59 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-20 18:03:59 -0800 |
commit | a24276924875802853b5bdc12c56d29f1c1bbc79 (patch) | |
tree | 5725689bf434004143ae875bbfee3d3d29ddcdb0 /net/netfilter/nf_conntrack_netlink.c | |
parent | c4b885139203d37f76662c37ae645fe8e0f4e4e5 (diff) | |
download | op-kernel-dev-a24276924875802853b5bdc12c56d29f1c1bbc79.zip op-kernel-dev-a24276924875802853b5bdc12c56d29f1c1bbc79.tar.gz |
[NETFILTER]: ctnetlink: avoid unneccessary event message generation
Avoid unneccessary event message generation by checking for netlink
listeners before building a message.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter/nf_conntrack_netlink.c')
-rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index aef3cb4..5eadf00 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c @@ -338,9 +338,10 @@ static int ctnetlink_conntrack_event(struct notifier_block *this, group = NFNLGRP_CONNTRACK_UPDATE; } else return NOTIFY_DONE; - - /* FIXME: Check if there are any listeners before, don't hurt performance */ - + + if (!nfnetlink_has_listeners(group)) + return NOTIFY_DONE; + skb = alloc_skb(NLMSG_GOODSIZE, GFP_ATOMIC); if (!skb) return NOTIFY_DONE; |