Message ID | 20241125104011.36552-6-cgoettsche@seltendoof.de (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [01/11] coccinelle: Add script to reorder capable() calls | expand |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 0d704bda6c41..bd3d7a3d6655 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -3406,8 +3406,8 @@ EXPORT_SYMBOL(tcp_disconnect); static inline bool tcp_can_repair_sock(const struct sock *sk) { - return sockopt_ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN) && - (sk->sk_state != TCP_LISTEN); + return (sk->sk_state != TCP_LISTEN) && + sockopt_ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN); } static int tcp_repair_set_window(struct tcp_sock *tp, sockptr_t optbuf, int len)