mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
[NETFILTER]: ctnetlink: avoid unneccessary event message generation
Avoid unneccessary event message generation by checking for netlink listeners before building a message. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
c4b8851392
commit
a242769248
4 changed files with 15 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue