diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-10-27 19:49:48 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-11-01 20:50:31 +0100 |
commit | 8db4c5be88f62ffd7a552f70687a10c614dc697b (patch) | |
tree | e4804a3bbcf2271d7ee5ca85f2b49e9e68abc9e1 /include/net/netfilter | |
parent | 1fddf4bad0ac9f4d32c74af286fc1eec2a03c82c (diff) | |
download | op-kernel-dev-8db4c5be88f62ffd7a552f70687a10c614dc697b.zip op-kernel-dev-8db4c5be88f62ffd7a552f70687a10c614dc697b.tar.gz |
netfilter: move socket lookup infrastructure to nf_socket_ipv{4,6}.c
We need this split to reuse existing codebase for the upcoming nf_tables
socket expression.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/net/netfilter')
-rw-r--r-- | include/net/netfilter/nf_socket.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/net/netfilter/nf_socket.h b/include/net/netfilter/nf_socket.h new file mode 100644 index 0000000..f2fc39c --- /dev/null +++ b/include/net/netfilter/nf_socket.h @@ -0,0 +1,27 @@ +#ifndef _NF_SOCK_H_ +#define _NF_SOCK_H_ + +struct net_device; +struct sk_buff; +struct sock; +struct net; + +static inline bool nf_sk_is_transparent(struct sock *sk) +{ + switch (sk->sk_state) { + case TCP_TIME_WAIT: + return inet_twsk(sk)->tw_transparent; + case TCP_NEW_SYN_RECV: + return inet_rsk(inet_reqsk(sk))->no_srccheck; + default: + return inet_sk(sk)->transparent; + } +} + +struct sock *nf_sk_lookup_slow_v4(struct net *net, const struct sk_buff *skb, + const struct net_device *indev); + +struct sock *nf_sk_lookup_slow_v6(struct net *net, const struct sk_buff *skb, + const struct net_device *indev); + +#endif |