diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2006-08-22 03:32:05 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 17:55:26 -0400 |
commit | b3a27bfba51d445784eb0cd6451b73a73fb69cf9 (patch) | |
tree | 0c697133c749cf83167c6e314a4c40ca14d520db /net | |
parent | b9a37e0c81c498be2db9f52063c53e55d76c815e (diff) |
[NETFILTER]: ctnetlink: check for listeners before sending expectation events
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/netfilter/ip_conntrack_netlink.c | 3 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/net/ipv4/netfilter/ip_conntrack_netlink.c b/net/ipv4/netfilter/ip_conntrack_netlink.c index 38708e6cfae7..ef84f43f0734 100644 --- a/net/ipv4/netfilter/ip_conntrack_netlink.c +++ b/net/ipv4/netfilter/ip_conntrack_netlink.c | |||
@@ -1257,6 +1257,9 @@ static int ctnetlink_expect_event(struct notifier_block *this, | |||
1257 | } else | 1257 | } else |
1258 | return NOTIFY_DONE; | 1258 | return NOTIFY_DONE; |
1259 | 1259 | ||
1260 | if (!nfnetlink_has_listeners(NFNLGRP_CONNTRACK_EXP_NEW)) | ||
1261 | return NOTIFY_DONE; | ||
1262 | |||
1260 | skb = alloc_skb(NLMSG_GOODSIZE, GFP_ATOMIC); | 1263 | skb = alloc_skb(NLMSG_GOODSIZE, GFP_ATOMIC); |
1261 | if (!skb) | 1264 | if (!skb) |
1262 | return NOTIFY_DONE; | 1265 | return NOTIFY_DONE; |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index aa0148f418a9..dc4f081dca91 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -1278,6 +1278,9 @@ static int ctnetlink_expect_event(struct notifier_block *this, | |||
1278 | } else | 1278 | } else |
1279 | return NOTIFY_DONE; | 1279 | return NOTIFY_DONE; |
1280 | 1280 | ||
1281 | if (!nfnetlink_has_listeners(NFNLGRP_CONNTRACK_EXP_NEW)) | ||
1282 | return NOTIFY_DONE; | ||
1283 | |||
1281 | skb = alloc_skb(NLMSG_GOODSIZE, GFP_ATOMIC); | 1284 | skb = alloc_skb(NLMSG_GOODSIZE, GFP_ATOMIC); |
1282 | if (!skb) | 1285 | if (!skb) |
1283 | return NOTIFY_DONE; | 1286 | return NOTIFY_DONE; |