ipv4: tcp: fix TOS value in ACK messages sent from TIME_WAIT
There is a long standing bug in linux tcp stack, about ACK messages sent on behalf of TIME_WAIT sockets. In the IP header of the ACK message, we choose to reflect TOS field of incoming message, and this might break some setups. Example of things that were broken : - Routing using TOS as a selector - Firewalls - Trafic classification / shaping We now remember in timewait structure the inet tos field and use it in ACK generation, and route lookup. Notes : - We still reflect incoming TOS in RST messages. - We could extend MuraliRaja Muniraju patch to report TOS value in netlink messages for TIME_WAIT sockets. - A patch is needed for IPv6 Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
318cf7aaa0
commit
66b13d99d9
@@ -183,6 +183,7 @@ struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, const int stat
|
||||
tw->tw_daddr = inet->inet_daddr;
|
||||
tw->tw_rcv_saddr = inet->inet_rcv_saddr;
|
||||
tw->tw_bound_dev_if = sk->sk_bound_dev_if;
|
||||
tw->tw_tos = inet->tos;
|
||||
tw->tw_num = inet->inet_num;
|
||||
tw->tw_state = TCP_TIME_WAIT;
|
||||
tw->tw_substate = state;
|
||||
|
Reference in New Issue
Block a user