aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/uapi/linux/inet_diag.h3
-rw-r--r--net/ipv4/inet_diag.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/include/uapi/linux/inet_diag.h b/include/uapi/linux/inet_diag.h
index b629fc53b109..68a1f71fde9f 100644
--- a/include/uapi/linux/inet_diag.h
+++ b/include/uapi/linux/inet_diag.h
@@ -112,9 +112,10 @@ enum {
112 INET_DIAG_SHUTDOWN, 112 INET_DIAG_SHUTDOWN,
113 INET_DIAG_DCTCPINFO, 113 INET_DIAG_DCTCPINFO,
114 INET_DIAG_PROTOCOL, /* response attribute only */ 114 INET_DIAG_PROTOCOL, /* response attribute only */
115 INET_DIAG_SKV6ONLY,
115}; 116};
116 117
117#define INET_DIAG_MAX INET_DIAG_PROTOCOL 118#define INET_DIAG_MAX INET_DIAG_SKV6ONLY
118 119
119/* INET_DIAG_MEM */ 120/* INET_DIAG_MEM */
120 121
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