diff options
author | Patrick McHardy <kaber@trash.net> | 2009-11-06 11:04:00 -0500 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2009-11-06 11:04:00 -0500 |
commit | dee5817e88ac8195e5938d6671f434a071e35698 (patch) | |
tree | 7697b0bf04c23f6b0c3dad9755a9a7c9b668365f /net/netfilter | |
parent | 76ac894080019c6619d3c3bf615db42a43a77f32 (diff) |
netfilter: remove unneccessary checks from netlink notifiers
The NETLINK_URELEASE notifier is only invoked for bound sockets, so
there is no need to check ->pid again.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nfnetlink_log.c | 3 | ||||
-rw-r--r-- | net/netfilter/nfnetlink_queue.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index f900dc3194af..3aa66b2f9e87 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c | |||
@@ -666,8 +666,7 @@ nfulnl_rcv_nl_event(struct notifier_block *this, | |||
666 | { | 666 | { |
667 | struct netlink_notify *n = ptr; | 667 | struct netlink_notify *n = ptr; |
668 | 668 | ||
669 | if (event == NETLINK_URELEASE && | 669 | if (event == NETLINK_URELEASE && n->protocol == NETLINK_NETFILTER) { |
670 | n->protocol == NETLINK_NETFILTER && n->pid) { | ||
671 | int i; | 670 | int i; |
672 | 671 | ||
673 | /* destroy all instances for this pid */ | 672 | /* destroy all instances for this pid */ |
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index 7a9dec9fb822..7e3fa410641e 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c | |||
@@ -574,8 +574,7 @@ nfqnl_rcv_nl_event(struct notifier_block *this, | |||
574 | { | 574 | { |
575 | struct netlink_notify *n = ptr; | 575 | struct netlink_notify *n = ptr; |
576 | 576 | ||
577 | if (event == NETLINK_URELEASE && | 577 | if (event == NETLINK_URELEASE && n->protocol == NETLINK_NETFILTER) { |
578 | n->protocol == NETLINK_NETFILTER && n->pid) { | ||
579 | int i; | 578 | int i; |
580 | 579 | ||
581 | /* destroy all instances for this pid */ | 580 | /* destroy all instances for this pid */ |