Commit 8b580147 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

netfilter: tproxy: prepare TCP_NEW_SYN_RECV support

TCP request socks soon will be visible in ehash table.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a8399231
...@@ -42,15 +42,21 @@ enum nf_tproxy_lookup_t { ...@@ -42,15 +42,21 @@ enum nf_tproxy_lookup_t {
static bool tproxy_sk_is_transparent(struct sock *sk) static bool tproxy_sk_is_transparent(struct sock *sk)
{ {
if (sk->sk_state != TCP_TIME_WAIT) { switch (sk->sk_state) {
if (inet_sk(sk)->transparent) case TCP_TIME_WAIT:
return true;
sock_put(sk);
} else {
if (inet_twsk(sk)->tw_transparent) if (inet_twsk(sk)->tw_transparent)
return true; return true;
inet_twsk_put(inet_twsk(sk)); break;
case TCP_NEW_SYN_RECV:
if (inet_rsk(inet_reqsk(sk))->no_srccheck)
return true;
break;
default:
if (inet_sk(sk)->transparent)
return true;
} }
sock_gen_put(sk);
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment