Commit 70aa9966 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Pablo Neira Ayuso

netfilter: kill nf_hooks_active

The function obscures what is going on in nf_hook_thresh and it's existence
requires computing the hook list twice.
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 0d6ef068
...@@ -150,11 +150,6 @@ static inline bool nf_hook_list_active(struct list_head *nf_hook_list, ...@@ -150,11 +150,6 @@ static inline bool nf_hook_list_active(struct list_head *nf_hook_list,
} }
#endif #endif
static inline bool nf_hooks_active(u_int8_t pf, unsigned int hook)
{
return nf_hook_list_active(&nf_hooks[pf][hook], pf, hook);
}
int nf_hook_slow(struct sk_buff *skb, struct nf_hook_state *state); int nf_hook_slow(struct sk_buff *skb, struct nf_hook_state *state);
/** /**
...@@ -172,10 +167,12 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, ...@@ -172,10 +167,12 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
int (*okfn)(struct sock *, struct sk_buff *), int (*okfn)(struct sock *, struct sk_buff *),
int thresh) int thresh)
{ {
if (nf_hooks_active(pf, hook)) { struct list_head *nf_hook_list = &nf_hooks[pf][hook];
if (nf_hook_list_active(nf_hook_list, pf, hook)) {
struct nf_hook_state state; struct nf_hook_state state;
nf_hook_state_init(&state, &nf_hooks[pf][hook], hook, thresh, nf_hook_state_init(&state, nf_hook_list, hook, thresh,
pf, indev, outdev, sk, okfn); pf, indev, outdev, sk, okfn);
return nf_hook_slow(skb, &state); return nf_hook_slow(skb, &state);
} }
......
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