summaryrefslogtreecommitdiff
path: root/include/linux/netfilter.h
diff options
context:
space:
mode:
authorDavid Miller <davem@davemloft.net>2015-04-05 22:19:00 -0400
committerDavid S. Miller <davem@davemloft.net>2015-04-07 15:25:55 -0400
commit1c984f8a5df085bcf35364a8a870bd4db4da4ed3 (patch)
tree14dcad3877bc1bb657a32888d2af007c13b9d856 /include/linux/netfilter.h
parent107a9f4dc9211c1f91703d1739d7fd22ac58b332 (diff)
netfilter: Add socket pointer to nf_hook_state.
It is currently always set to NULL, but nf_queue is adjusted to be prepared for it being set to a real socket by taking and releasing a reference to that socket when necessary. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netfilter.h')
-rw-r--r--include/linux/netfilter.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index b8c88f3c85ff..f8f58fab2402 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -45,12 +45,15 @@ struct sk_buff;
struct nf_hook_ops;
+struct sock;
+
struct nf_hook_state {
unsigned int hook;
int thresh;
u_int8_t pf;
struct net_device *in;
struct net_device *out;
+ struct sock *sk;
int (*okfn)(struct sk_buff *);
};
@@ -59,6 +62,7 @@ static inline void nf_hook_state_init(struct nf_hook_state *p,
int thresh, u_int8_t pf,
struct net_device *indev,
struct net_device *outdev,
+ struct sock *sk,
int (*okfn)(struct sk_buff *))
{
p->hook = hook;
@@ -66,6 +70,7 @@ static inline void nf_hook_state_init(struct nf_hook_state *p,
p->pf = pf;
p->in = indev;
p->out = outdev;
+ p->sk = sk;
p->okfn = okfn;
}
@@ -160,7 +165,7 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook,
struct nf_hook_state state;
nf_hook_state_init(&state, hook, thresh, pf,
- indev, outdev, okfn);
+ indev, outdev, NULL, okfn);
return nf_hook_slow(skb, &state);
}
return 1;