diff options
-rw-r--r-- | net/ipv4/inet_diag.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 9bc26677058e..c3b1f3a0f4cf 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
@@ -152,8 +152,8 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk, | |||
152 | inet6_sk(sk)->tclass) < 0) | 152 | inet6_sk(sk)->tclass) < 0) |
153 | goto errout; | 153 | goto errout; |
154 | 154 | ||
155 | if (ipv6_only_sock(sk) && | 155 | if (((1 << sk->sk_state) & (TCPF_LISTEN | TCPF_CLOSE)) && |
156 | nla_put_u8(skb, INET_DIAG_SKV6ONLY, 1)) | 156 | nla_put_u8(skb, INET_DIAG_SKV6ONLY, ipv6_only_sock(sk))) |
157 | goto errout; | 157 | goto errout; |
158 | } | 158 | } |
159 | #endif | 159 | #endif |