mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 11:16:11 +00:00
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>
This commit is contained in:
parent
76ac894080
commit
dee5817e88
4 changed files with 4 additions and 8 deletions
|
@ -497,8 +497,7 @@ ipq_rcv_nl_event(struct notifier_block *this,
|
|||
{
|
||||
struct netlink_notify *n = ptr;
|
||||
|
||||
if (event == NETLINK_URELEASE &&
|
||||
n->protocol == NETLINK_FIREWALL && n->pid) {
|
||||
if (event == NETLINK_URELEASE && n->protocol == NETLINK_FIREWALL) {
|
||||
write_lock_bh(&queue_lock);
|
||||
if ((n->net == &init_net) && (n->pid == peer_pid))
|
||||
__ipq_reset();
|
||||
|
|
|
@ -499,8 +499,7 @@ ipq_rcv_nl_event(struct notifier_block *this,
|
|||
{
|
||||
struct netlink_notify *n = ptr;
|
||||
|
||||
if (event == NETLINK_URELEASE &&
|
||||
n->protocol == NETLINK_IP6_FW && n->pid) {
|
||||
if (event == NETLINK_URELEASE && n->protocol == NETLINK_IP6_FW) {
|
||||
write_lock_bh(&queue_lock);
|
||||
if ((n->net == &init_net) && (n->pid == peer_pid))
|
||||
__ipq_reset();
|
||||
|
|
|
@ -666,8 +666,7 @@ nfulnl_rcv_nl_event(struct notifier_block *this,
|
|||
{
|
||||
struct netlink_notify *n = ptr;
|
||||
|
||||
if (event == NETLINK_URELEASE &&
|
||||
n->protocol == NETLINK_NETFILTER && n->pid) {
|
||||
if (event == NETLINK_URELEASE && n->protocol == NETLINK_NETFILTER) {
|
||||
int i;
|
||||
|
||||
/* destroy all instances for this pid */
|
||||
|
|
|
@ -574,8 +574,7 @@ nfqnl_rcv_nl_event(struct notifier_block *this,
|
|||
{
|
||||
struct netlink_notify *n = ptr;
|
||||
|
||||
if (event == NETLINK_URELEASE &&
|
||||
n->protocol == NETLINK_NETFILTER && n->pid) {
|
||||
if (event == NETLINK_URELEASE && n->protocol == NETLINK_NETFILTER) {
|
||||
int i;
|
||||
|
||||
/* destroy all instances for this pid */
|
||||
|
|
Loading…
Reference in a new issue