Commit dee5817e authored by Patrick McHardy's avatar Patrick McHardy

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: default avatarPatrick McHardy <kaber@trash.net>
parent 76ac8940
...@@ -497,8 +497,7 @@ ipq_rcv_nl_event(struct notifier_block *this, ...@@ -497,8 +497,7 @@ ipq_rcv_nl_event(struct notifier_block *this,
{ {
struct netlink_notify *n = ptr; struct netlink_notify *n = ptr;
if (event == NETLINK_URELEASE && if (event == NETLINK_URELEASE && n->protocol == NETLINK_FIREWALL) {
n->protocol == NETLINK_FIREWALL && n->pid) {
write_lock_bh(&queue_lock); write_lock_bh(&queue_lock);
if ((n->net == &init_net) && (n->pid == peer_pid)) if ((n->net == &init_net) && (n->pid == peer_pid))
__ipq_reset(); __ipq_reset();
......
...@@ -499,8 +499,7 @@ ipq_rcv_nl_event(struct notifier_block *this, ...@@ -499,8 +499,7 @@ ipq_rcv_nl_event(struct notifier_block *this,
{ {
struct netlink_notify *n = ptr; struct netlink_notify *n = ptr;
if (event == NETLINK_URELEASE && if (event == NETLINK_URELEASE && n->protocol == NETLINK_IP6_FW) {
n->protocol == NETLINK_IP6_FW && n->pid) {
write_lock_bh(&queue_lock); write_lock_bh(&queue_lock);
if ((n->net == &init_net) && (n->pid == peer_pid)) if ((n->net == &init_net) && (n->pid == peer_pid))
__ipq_reset(); __ipq_reset();
......
...@@ -666,8 +666,7 @@ nfulnl_rcv_nl_event(struct notifier_block *this, ...@@ -666,8 +666,7 @@ nfulnl_rcv_nl_event(struct notifier_block *this,
{ {
struct netlink_notify *n = ptr; struct netlink_notify *n = ptr;
if (event == NETLINK_URELEASE && if (event == NETLINK_URELEASE && n->protocol == NETLINK_NETFILTER) {
n->protocol == NETLINK_NETFILTER && n->pid) {
int i; int i;
/* destroy all instances for this pid */ /* destroy all instances for this pid */
......
...@@ -574,8 +574,7 @@ nfqnl_rcv_nl_event(struct notifier_block *this, ...@@ -574,8 +574,7 @@ nfqnl_rcv_nl_event(struct notifier_block *this,
{ {
struct netlink_notify *n = ptr; struct netlink_notify *n = ptr;
if (event == NETLINK_URELEASE && if (event == NETLINK_URELEASE && n->protocol == NETLINK_NETFILTER) {
n->protocol == NETLINK_NETFILTER && n->pid) {
int i; int i;
/* destroy all instances for this pid */ /* destroy all instances for this pid */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment