|
@@ -152,8 +152,8 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
|
|
inet6_sk(sk)->tclass) < 0)
|
|
inet6_sk(sk)->tclass) < 0)
|
|
goto errout;
|
|
goto errout;
|
|
|
|
|
|
- if (ipv6_only_sock(sk) &&
|
|
|
|
- nla_put_u8(skb, INET_DIAG_SKV6ONLY, 1))
|
|
|
|
|
|
+ if (((1 << sk->sk_state) & (TCPF_LISTEN | TCPF_CLOSE)) &&
|
|
|
|
+ nla_put_u8(skb, INET_DIAG_SKV6ONLY, ipv6_only_sock(sk)))
|
|
goto errout;
|
|
goto errout;
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|