Re: [PATCH 1/3] tcp: allow to enable repair mode for sockets in any state

From: Pavel Emelyanov
Date: Mon Mar 24 2014 - 18:47:50 EST


> @@ -2375,7 +2378,7 @@ void tcp_sock_destruct(struct sock *sk)
> static inline bool tcp_can_repair_sock(const struct sock *sk)
> {
> return ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN) &&
> - ((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_ESTABLISHED));
> + (sk->sk_state != TCP_LISTEN);

This set only covers states that may happen after ESTABLISHED, so
I would still exclude others (e.g. syn-sent) from the white list.

> }
>
> static int tcp_repair_options_est(struct tcp_sock *tp,
>

Thanks,
Pavel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/