tcp: honor SO_PRIORITY in TIME_WAIT state
authorEric Dumazet <edumazet@google.com>
Tue, 24 Sep 2019 15:01:16 +0000 (08:01 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Sep 2019 10:05:02 +0000 (12:05 +0200)
commitf6c0f5d209fa80eb808e08aa4206f6e264041ef6
treea3c9c3a820ff3b8cc28671d498fad022142f74ff
parente9a5dceee56cb527a3498f1a59bd8726baa1e717
tcp: honor SO_PRIORITY in TIME_WAIT state

ctl packets sent on behalf of TIME_WAIT sockets currently
have a zero skb->priority, which can cause various problems.

In this patch we :

- add a tw_priority field in struct inet_timewait_sock.

- populate it from sk->sk_priority when a TIME_WAIT is created.

- For IPv4, change ip_send_unicast_reply() and its two
  callers to propagate tw_priority correctly.
  ip_send_unicast_reply() no longer changes sk->sk_priority.

- For IPv6, make sure TIME_WAIT sockets pass their tw_priority
  field to tcp_v6_send_response() and tcp_v6_send_ack().

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inet_timewait_sock.h
net/ipv4/ip_output.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_minisocks.c
net/ipv6/tcp_ipv6.c