summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2015-07-10 18:13:20 -0500
committerPablo Neira Ayuso <pablo@netfilter.org>2015-07-15 17:51:42 +0200
commit70aa996601335ca3069190ebcdae8870828086a8 (patch)
tree8b819c1bf12fb15179f8d75ccfbb9a8d9e469730
parent0d6ef0688d8744454646298b85336407be05e309 (diff)
downloadop-kernel-dev-70aa996601335ca3069190ebcdae8870828086a8.zip
op-kernel-dev-70aa996601335ca3069190ebcdae8870828086a8.tar.gz
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: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--include/linux/netfilter.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 00050df..60e89348 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -150,11 +150,6 @@ static inline bool nf_hook_list_active(struct list_head *nf_hook_list,
}
#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);
/**
@@ -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 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;
- 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);
return nf_hook_slow(skb, &state);
}
OpenPOWER on IntegriCloud