Skip to contentSkip to conversation

send expectation events iif there listeners

PATCH Applied Pablo Neira Ayuso 2 participants 2 messages Jul 25, 2006 – Aug 8, 2006

Subsystems (2)
lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 3/8 send expectation events iif there listeners

This patch uses nfnetlink_has_listeners to check for listeners in userspace.

Signature · 1 line
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 iif there are listeners

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
===================================================================
@@ -1260,6 +1260,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
===================================================================
@@ -1281,6 +1281,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;
#1 lore raw
Quoted 2 lines · Pablo Neira Ayuso

This patch uses nfnetlink_has_listeners to check for listeners in userspace.

Applied, thanks.