mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 08:19:28 +00:00
![Máté Eckl](/assets/img/avatar_default.png)
There is a function in include/net/netfilter/nf_socket.h to decide if a socket has IP(V6)_TRANSPARENT socket option set or not. However this does the same as inet_sk_transparent() in include/net/tcp.h include/net/tcp.h:1733 /* This helper checks if socket has IP_TRANSPARENT set */ static inline bool inet_sk_transparent(const 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; } return inet_sk(sk)->transparent; } tproxy_sk_is_transparent has also been refactored to use this function instead of reimplementing it. Signed-off-by: Máté Eckl <ecklm94@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
13 lines
346 B
C
13 lines
346 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _NF_SOCK_H_
|
|
#define _NF_SOCK_H_
|
|
|
|
#include <net/sock.h>
|
|
|
|
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
|