tcp: record received TOS value in the request socket

A new field is added to the request sock to record the TOS value
received on the listening socket during 3WHS:
When not under syn flood, it is recording the TOS value sent in SYN.
When under syn flood, it is recording the TOS value sent in the ACK.
This is a preparation patch in order to do TOS reflection in the later
commit.

Signed-off-by: Wei Wang <weiwan@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Wei Wang
2020-09-09 17:50:46 -07:00
committed by David S. Miller
parent 3a8c4ad161
commit e9b12edc13
3 changed files with 5 additions and 3 deletions

View File

@@ -134,6 +134,7 @@ struct tcp_request_sock {
* FastOpen it's the seq#
* after data-in-SYN.
*/
u8 syn_tos;
};
static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)