diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/netfilter.h | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 0060fde31..caaf0f088 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h @@ -97,24 +97,6 @@ void nf_unregister_sockopt(struct nf_sockopt_ops *reg); extern struct list_head nf_hooks[NFPROTO_NUMPROTO][NF_MAX_HOOKS]; -#if defined(CONFIG_JUMP_LABEL) -#include <linux/static_key.h> -extern struct static_key nf_hooks_needed[NFPROTO_NUMPROTO][NF_MAX_HOOKS]; -static inline bool nf_hooks_active(u_int8_t pf, unsigned int hook) -{ - if (__builtin_constant_p(pf) && - __builtin_constant_p(hook)) - return static_key_false(&nf_hooks_needed[pf][hook]); - - return !list_empty(&nf_hooks[pf][hook]); -} -#else -static inline bool nf_hooks_active(u_int8_t pf, unsigned int hook) -{ - return !list_empty(&nf_hooks[pf][hook]); -} -#endif - int nf_hook_slow(u_int8_t pf, unsigned int hook, struct sk_buff *skb, struct net_device *indev, struct net_device *outdev, int (*okfn)(struct sk_buff *), int thresh); @@ -132,9 +114,11 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, struct net_device *outdev, int (*okfn)(struct sk_buff *), int thresh) { - if (nf_hooks_active(pf, hook)) - return nf_hook_slow(pf, hook, skb, indev, outdev, okfn, thresh); - return 1; +#ifndef CONFIG_NETFILTER_DEBUG + if (list_empty(&nf_hooks[pf][hook])) + return 1; +#endif + return nf_hook_slow(pf, hook, skb, indev, outdev, okfn, thresh); } static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb, |
