summaryrefslogtreecommitdiff
path: root/include/linux/netfilter.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-04-12 05:27:19 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-12 05:27:19 +0300
commit39c853ebfe169f187a760b34f9cbf54751bfce00 (patch)
tree2a5a741d0cff7d4f90998b31b32ff80cfccd0369 /include/linux/netfilter.h
parentfdc81f45e9f57858da6351836507fbcf1b7583ee (diff)
parent01e97e6517053d7c0b9af5248e944a9209909cf5 (diff)
downloadlinux-39c853ebfe169f187a760b34f9cbf54751bfce00.tar.xz
Merge branch 'for-davem' into for-next
Diffstat (limited to 'include/linux/netfilter.h')
-rw-r--r--include/linux/netfilter.h32
1 files changed, 24 insertions, 8 deletions
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 2517ece98820..c480c43ad8f7 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -44,11 +44,19 @@ int netfilter_init(void);
struct sk_buff;
struct nf_hook_ops;
+
+struct nf_hook_state {
+ unsigned int hook;
+ int thresh;
+ u_int8_t pf;
+ struct net_device *in;
+ struct net_device *out;
+ int (*okfn)(struct sk_buff *);
+};
+
typedef unsigned int nf_hookfn(const struct nf_hook_ops *ops,
struct sk_buff *skb,
- const struct net_device *in,
- const struct net_device *out,
- int (*okfn)(struct sk_buff *));
+ const struct nf_hook_state *state);
struct nf_hook_ops {
struct list_head list;
@@ -118,9 +126,7 @@ static inline bool nf_hooks_active(u_int8_t pf, unsigned int 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);
+int nf_hook_slow(struct sk_buff *skb, struct nf_hook_state *state);
/**
* nf_hook_thresh - call a netfilter hook
@@ -135,8 +141,18 @@ 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);
+ if (nf_hooks_active(pf, hook)) {
+ struct nf_hook_state state = {
+ .hook = hook,
+ .thresh = thresh,
+ .pf = pf,
+ .in = indev,
+ .out = outdev,
+ .okfn = okfn
+ };
+
+ return nf_hook_slow(skb, &state);
+ }
return 1;
}