Skip to contentSkip to conversation

send expectation events if someone is listening to

PATCH In review Pablo Neira Ayuso 1 participant 1 message Jul 7, 2006

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 9/10 send expectation events if someone is listening to

This patch uses nfnetlink_has_listeners to check for listeners in userspace.

Signature · 2 lines
The dawn of the fourth age of Linux firewalling is coming; a time of
great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris

[CTNETLINK] send expectation events if someone is listening to

This patch uses nfnetlink_has_listeners to check for listeners in userspace.

net/ipv4/netfilter/ip_conntrack_netlink.c +3 -0
Index: net-2.6/net/ipv4/netfilter/ip_conntrack_netlink.c
===================================================================
@@ -1286,6 +1286,9 @@ static int ctnetlink_expect_event(struct
 	} 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;
net/netfilter/nf_conntrack_netlink.c +3 -0
Index: net-2.6/net/netfilter/nf_conntrack_netlink.c
===================================================================
@@ -1312,6 +1312,9 @@ static int ctnetlink_expect_event(struct
 	} 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;