提交 98a45425 编写于 作者: E Eric Dumazet 提交者: Jialin Zhang

raw: fix a typo in raw_icmp_error()

mainline inclusion
from mainline-v6.0-rc1
commit 97a4d46b
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6ECEK
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=97a4d46b1516250d640c1ae0c9e7129d160d6a1c

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

I accidentally broke IPv4 traceroute, by swapping iph->saddr
and iph->daddr.

Probably because raw_icmp_error() and raw_v4_input()
use different order for iph->saddr and iph->daddr.

Fixes: ba44f818 ("raw: use more conventional iterators")
Reported-by: NJohn Sperbeck <jsperbeck@google.com>
Signed-off-by: NEric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20220623193540.2851799-1-edumazet@google.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
Signed-off-by: NZiyang Xuan <william.xuanziyang@huawei.com>
Reviewed-by: NYue Haibing <yuehaibing@huawei.com>
Signed-off-by: NJialin Zhang <zhangjialin11@huawei.com>
上级 16cd6a7c
...@@ -278,7 +278,7 @@ void raw_icmp_error(struct sk_buff *skb, int protocol, u32 info) ...@@ -278,7 +278,7 @@ void raw_icmp_error(struct sk_buff *skb, int protocol, u32 info)
sk_nulls_for_each(sk, hnode, hlist) { sk_nulls_for_each(sk, hnode, hlist) {
iph = (const struct iphdr *)skb->data; iph = (const struct iphdr *)skb->data;
if (!raw_v4_match(net, sk, iph->protocol, if (!raw_v4_match(net, sk, iph->protocol,
iph->saddr, iph->daddr, dif, sdif)) iph->daddr, iph->saddr, dif, sdif))
continue; continue;
raw_err(sk, skb, info); raw_err(sk, skb, info);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册