Commit 052e0690 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

ipv6: tcp: fix flowlabels reflection for RST packets

In 323a53c4 ("ipv6: tcp: enable flowlabel reflection in some RST packets")
and 50a8accf ("ipv6: tcp: send consistent flowlabel in TIME_WAIT state")
we took care of IPv6 flowlabel reflections for two cases.

This patch takes care of the remaining case, when the RST packet
is sent on behalf of a 'full' socket.

In Marek use case, this was a socket in TCP_CLOSE state.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reported-by: default avatarMarek Majkowski <marek@cloudflare.com>
Tested-by: default avatarMarek Majkowski <marek@cloudflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 416e8126
...@@ -984,8 +984,13 @@ static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb) ...@@ -984,8 +984,13 @@ static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb)
if (sk) { if (sk) {
oif = sk->sk_bound_dev_if; oif = sk->sk_bound_dev_if;
if (sk_fullsock(sk)) if (sk_fullsock(sk)) {
const struct ipv6_pinfo *np = tcp_inet6_sk(sk);
trace_tcp_send_reset(sk, skb); trace_tcp_send_reset(sk, skb);
if (np->repflow)
label = ip6_flowlabel(ipv6h);
}
if (sk->sk_state == TCP_TIME_WAIT) if (sk->sk_state == TCP_TIME_WAIT)
label = cpu_to_be32(inet_twsk(sk)->tw_flowlabel); label = cpu_to_be32(inet_twsk(sk)->tw_flowlabel);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment