summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoshe Tal <moshet@nvidia.com>2022-01-16 19:39:29 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-01-27 12:03:03 +0100
commitc5ed18a4ba1ba4579ab5539e9b187d3f0d5067e1 (patch)
treea4adf40126ce672f0011bccaf0acfd4895fb2ae6
parent017ef7c25c8394753144391dbd2c1667b98e31ab (diff)
downloadlinux-c5ed18a4ba1ba4579ab5539e9b187d3f0d5067e1.tar.gz
linux-c5ed18a4ba1ba4579ab5539e9b187d3f0d5067e1.tar.bz2
linux-c5ed18a4ba1ba4579ab5539e9b187d3f0d5067e1.zip
bonding: Fix extraction of ports from the packet headers
commit 429e3d123d9a50cc9882402e40e0ac912d88cfcf upstream. 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: a815bde56b15 ("net, bonding: Refactor bond_xmit_hash for use with xdp_buff") Reviewed-by: Jussi Maki <joamaki@gmail.com> Reviewed-by: Saeed Mahameed <saeedm@nvidia.com> Reviewed-by: Gal Pressman <gal@nvidia.com> Signed-off-by: Moshe Tal <moshet@nvidia.com> Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/bonding/bond_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 04c873425767..1db5c7a172a7 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3872,8 +3872,8 @@ u32 bond_xmit_hash(struct bonding *bond, struct sk_buff *skb)
skb->l4_hash)
return skb->hash;
- return __bond_xmit_hash(bond, skb, skb->head, skb->protocol,
- skb->mac_header, skb->network_header,
+ return __bond_xmit_hash(bond, skb, skb->data, skb->protocol,
+ skb_mac_offset(skb), skb_network_offset(skb),
skb_headlen(skb));
}