diff options
author | David S. Miller <davem@davemloft.net> | 2011-11-26 14:47:03 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-26 14:47:03 -0500 |
commit | 6dec4ac4ee1ad894dc0e9647cd3e180f93fc353c (patch) | |
tree | cd71e597bbbe677820bb229c6aedbad412758959 /net/ipv4/inet_diag.c | |
parent | d6f03f29f7cdf064289f941bf0b838348e996e65 (diff) | |
parent | fc0b927d9a5024e138c4318fe19a590f23e3eeec (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
net/ipv4/inet_diag.c
Diffstat (limited to 'net/ipv4/inet_diag.c')
-rw-r--r-- | net/ipv4/inet_diag.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index bbebdecd723..0a46c541b47 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c @@ -108,9 +108,6 @@ static int inet_csk_diag_fill(struct sock *sk, icsk->icsk_ca_ops->name); } - if ((ext & (1 << (INET_DIAG_TOS - 1))) && (sk->sk_family != AF_INET6)) - RTA_PUT_U8(skb, INET_DIAG_TOS, inet->tos); - r->idiag_family = sk->sk_family; r->idiag_state = sk->sk_state; r->idiag_timer = 0; @@ -125,6 +122,12 @@ static int inet_csk_diag_fill(struct sock *sk, r->id.idiag_src[0] = inet->inet_rcv_saddr; r->id.idiag_dst[0] = inet->inet_daddr; + /* IPv6 dual-stack sockets use inet->tos for IPv4 connections, + * hence this needs to be included regardless of socket family. + */ + if (ext & (1 << (INET_DIAG_TOS - 1))) + RTA_PUT_U8(skb, INET_DIAG_TOS, inet->tos); + #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) if (r->idiag_family == AF_INET6) { const struct ipv6_pinfo *np = inet6_sk(sk); |