提交 a2b07800 编写于 作者: W Wei Wang 提交者: Yang Yingliang

ip: fix tos reflection in ack and reset packets

stable inclusion
from linux-4.19.148
commit 2fc322bf67594e240eb23b4e0c6c8a09c69f9918

--------------------------------

[ Upstream commit ba9e04a7 ]

Currently, in tcp_v4_reqsk_send_ack() and tcp_v4_send_reset(), we
echo the TOS value of the received packets in the response.
However, we do not want to echo the lower 2 ECN bits in accordance
with RFC 3168 6.1.5 robustness principles.

Fixes: 1da177e4 ("Linux-2.6.12-rc2")
Signed-off-by: NWei Wang <weiwan@google.com>
Signed-off-by: NEric Dumazet <edumazet@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NAichun Li <liaichun@huawei.com>
Reviewed-by: Nwangxiaopeng <wangxiaopeng7@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 edce2f81
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
#include <net/icmp.h> #include <net/icmp.h>
#include <net/checksum.h> #include <net/checksum.h>
#include <net/inetpeer.h> #include <net/inetpeer.h>
#include <net/inet_ecn.h>
#include <net/lwtunnel.h> #include <net/lwtunnel.h>
#include <linux/bpf-cgroup.h> #include <linux/bpf-cgroup.h>
#include <linux/igmp.h> #include <linux/igmp.h>
...@@ -1582,7 +1583,7 @@ void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb, ...@@ -1582,7 +1583,7 @@ void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb,
if (IS_ERR(rt)) if (IS_ERR(rt))
return; return;
inet_sk(sk)->tos = arg->tos; inet_sk(sk)->tos = arg->tos & ~INET_ECN_MASK;
sk->sk_priority = skb->priority; sk->sk_priority = skb->priority;
sk->sk_protocol = ip_hdr(skb)->protocol; sk->sk_protocol = ip_hdr(skb)->protocol;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册