diff options
author | Phil Sutter <phil@nwl.cc> | 2015-06-24 05:02:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-06-24 05:51:39 -0400 |
commit | 204621551b2a0060a013b92f7add4d5c452fa7cb (patch) | |
tree | 5beead1f14aa004321b672edaad81e6a0a1730ab /net | |
parent | f389a40ec30f1c6c63eb61ec104d7c9886e1109a (diff) |
net: inet_diag: export IPV6_V6ONLY sockopt
For AF_INET6 sockets, the value of struct ipv6_pinfo.ipv6only is
exported to userspace. It indicates whether a socket bound to in6addr_any
listens on IPv4 as well as IPv6. Since the socket is natively IPv6, it is not
listed by e.g. 'ss -l -4'.
This patch is accompanied by an appropriate one for iproute2 to enable
the additional information in 'ss -e'.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/inet_diag.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 516a1f6fbdd3..9bc26677058e 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
@@ -151,6 +151,10 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk, | |||
151 | if (nla_put_u8(skb, INET_DIAG_TCLASS, | 151 | if (nla_put_u8(skb, INET_DIAG_TCLASS, |
152 | inet6_sk(sk)->tclass) < 0) | 152 | inet6_sk(sk)->tclass) < 0) |
153 | goto errout; | 153 | goto errout; |
154 | |||
155 | if (ipv6_only_sock(sk) && | ||
156 | nla_put_u8(skb, INET_DIAG_SKV6ONLY, 1)) | ||
157 | goto errout; | ||
154 | } | 158 | } |
155 | #endif | 159 | #endif |
156 | 160 | ||