提交 12fd3cb9 编写于 作者: M Moshe Tal 提交者: Zhengchao Shao

bonding: Fix extraction of ports from the packet headers

mainline inclusion
from mainline-v5.17-rc1
commit 429e3d12
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I7NDRB
CVE: NA

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

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

Wrong hash sends single stream to multiple output interfaces.

The offset calculation was relative to skb->head, fix it to be relative
to skb->data.

Fixes: a815bde5 ("net, bonding: Refactor bond_xmit_hash for use with
xdp_buff")
Reviewed-by: NJussi Maki <joamaki@gmail.com>
Reviewed-by: NSaeed Mahameed <saeedm@nvidia.com>
Reviewed-by: NGal Pressman <gal@nvidia.com>
Signed-off-by: NMoshe Tal <moshet@nvidia.com>
Acked-by: NJay Vosburgh <jay.vosburgh@canonical.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NZhengchao Shao <shaozhengchao@huawei.com>
上级 3a97e2ae
...@@ -3808,8 +3808,8 @@ u32 bond_xmit_hash(struct bonding *bond, struct sk_buff *skb) ...@@ -3808,8 +3808,8 @@ u32 bond_xmit_hash(struct bonding *bond, struct sk_buff *skb)
skb->l4_hash) skb->l4_hash)
return skb->hash; return skb->hash;
return __bond_xmit_hash(bond, skb, skb->head, skb->protocol, return __bond_xmit_hash(bond, skb, skb->data, skb->protocol,
skb->mac_header, skb->network_header, skb_mac_offset(skb), skb_network_offset(skb),
skb_headlen(skb)); skb_headlen(skb));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册