Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22177
b: refs/heads/master
c: a242769
h: refs/heads/master
i:
  22175: f0fa4c6
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Mar 21, 2006
1 parent 6ffa062 commit 4d6ced6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c4b885139203d37f76662c37ae645fe8e0f4e4e5
refs/heads/master: a24276924875802853b5bdc12c56d29f1c1bbc79
1 change: 1 addition & 0 deletions trunk/include/linux/netfilter/nfnetlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ extern void nfattr_parse(struct nfattr *tb[], int maxattr,
__res; \
})

extern int nfnetlink_has_listeners(unsigned int group);
extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group,
int echo);
extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags);
Expand Down
7 changes: 4 additions & 3 deletions trunk/net/ipv4/netfilter/ip_conntrack_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,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;
Expand Down
7 changes: 4 additions & 3 deletions trunk/net/netfilter/nf_conntrack_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions trunk/net/netfilter/nfnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ nfnetlink_check_attributes(struct nfnetlink_subsystem *subsys,
return 0;
}

int nfnetlink_has_listeners(unsigned int group)
{
return netlink_has_listeners(nfnl, group);
}
EXPORT_SYMBOL_GPL(nfnetlink_has_listeners);

int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, int echo)
{
gfp_t allocation = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL;
Expand Down

0 comments on commit 4d6ced6

Please sign in to comment.