diff options
Diffstat (limited to 'net/netfilter/core.c')
-rw-r--r-- | net/netfilter/core.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/net/netfilter/core.c b/net/netfilter/core.c index 85e9c959aba7..78f046ec506f 100644 --- a/net/netfilter/core.c +++ b/net/netfilter/core.c @@ -307,12 +307,6 @@ nf_hook_entry_head(struct net *net, int pf, unsigned int hooknum, return &dev->nf_hooks_ingress; } #endif -#ifdef CONFIG_NETFILTER_EGRESS - if (hooknum == NF_NETDEV_EGRESS) { - if (dev && dev_net(dev) == net) - return &dev->nf_hooks_egress; - } -#endif WARN_ON_ONCE(1); return NULL; } @@ -324,13 +318,11 @@ static int __nf_register_net_hook(struct net *net, int pf, struct nf_hook_entries __rcu **pp; if (pf == NFPROTO_NETDEV) { - if ((!IS_ENABLED(CONFIG_NETFILTER_INGRESS) && - reg->hooknum == NF_NETDEV_INGRESS) || - (!IS_ENABLED(CONFIG_NETFILTER_EGRESS) && - reg->hooknum == NF_NETDEV_EGRESS)) +#ifndef CONFIG_NETFILTER_INGRESS + if (reg->hooknum == NF_NETDEV_INGRESS) return -EOPNOTSUPP; - if ((reg->hooknum != NF_NETDEV_INGRESS && - reg->hooknum != NF_NETDEV_EGRESS) || +#endif + if (reg->hooknum != NF_NETDEV_INGRESS || !reg->dev || dev_net(reg->dev) != net) return -EINVAL; } @@ -356,10 +348,6 @@ static int __nf_register_net_hook(struct net *net, int pf, if (pf == NFPROTO_NETDEV && reg->hooknum == NF_NETDEV_INGRESS) net_inc_ingress_queue(); #endif -#ifdef CONFIG_NETFILTER_EGRESS - if (pf == NFPROTO_NETDEV && reg->hooknum == NF_NETDEV_EGRESS) - net_inc_egress_queue(); -#endif #ifdef CONFIG_JUMP_LABEL static_key_slow_inc(&nf_hooks_needed[pf][reg->hooknum]); #endif @@ -418,10 +406,6 @@ static void __nf_unregister_net_hook(struct net *net, int pf, if (pf == NFPROTO_NETDEV && reg->hooknum == NF_NETDEV_INGRESS) net_dec_ingress_queue(); #endif -#ifdef CONFIG_NETFILTER_EGRESS - if (pf == NFPROTO_NETDEV && reg->hooknum == NF_NETDEV_EGRESS) - net_dec_egress_queue(); -#endif #ifdef CONFIG_JUMP_LABEL static_key_slow_dec(&nf_hooks_needed[pf][reg->hooknum]); #endif |