Message ID | 20210310053222.41371-11-xiyou.wangcong@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | None | expand |
diff --git a/net/core/sock_map.c b/net/core/sock_map.c index 82e33622a020..69293495c4a9 100644 --- a/net/core/sock_map.c +++ b/net/core/sock_map.c @@ -549,7 +549,10 @@ static bool sk_is_udp(const struct sock *sk) static bool sock_map_redirect_allowed(const struct sock *sk) { - return sk_is_tcp(sk) && sk->sk_state != TCP_LISTEN; + if (sk_is_tcp(sk)) + return sk->sk_state != TCP_LISTEN; + else + return sk->sk_state == TCP_ESTABLISHED; } static bool sock_map_sk_is_suitable(const struct sock *sk)