]> err.no Git - linux-2.6/commitdiff
[NETFILTER]: ctnetlink: check for listeners before sending expectation events
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 22 Aug 2006 07:32:05 +0000 (00:32 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 22 Sep 2006 21:55:26 +0000 (14:55 -0700)
This patch uses nfnetlink_has_listeners to check for listeners in
userspace.

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>
net/ipv4/netfilter/ip_conntrack_netlink.c
net/netfilter/nf_conntrack_netlink.c

index 38708e6cfae7cd6567bd7012dd83fa47c4b0a504..ef84f43f07347de726256e1413527f962c74963f 100644 (file)
@@ -1257,6 +1257,9 @@ static int ctnetlink_expect_event(struct notifier_block *this,
        } else
                return NOTIFY_DONE;
 
+       if (!nfnetlink_has_listeners(NFNLGRP_CONNTRACK_EXP_NEW))
+               return NOTIFY_DONE;
+
        skb = alloc_skb(NLMSG_GOODSIZE, GFP_ATOMIC);
        if (!skb)
                return NOTIFY_DONE;
index aa0148f418a9094a3c72478eab612c4b086e1f96..dc4f081dca914106df589b8878377c015615802e 100644 (file)
@@ -1278,6 +1278,9 @@ static int ctnetlink_expect_event(struct notifier_block *this,
        } else
                return NOTIFY_DONE;
 
+       if (!nfnetlink_has_listeners(NFNLGRP_CONNTRACK_EXP_NEW))
+               return NOTIFY_DONE;
+
        skb = alloc_skb(NLMSG_GOODSIZE, GFP_ATOMIC);
        if (!skb)
                return NOTIFY_DONE;