[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220110081537.82477-1-moshet@nvidia.com>
Date: Mon, 10 Jan 2022 10:15:37 +0200
From: Moshe Tal <moshet@...dia.com>
To: Jay Vosburgh <j.vosburgh@...il.com>,
Veaceslav Falico <vfalico@...il.com>,
Andy Gospodarek <andy@...yhouse.net>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
CC: <netdev@...r.kernel.org>, Jussi Maki <joamaki@...il.com>,
Daniel Borkmann <daniel@...earbox.net>,
Tariq Toukan <tariqt@...dia.com>,
Moshe Tal <moshet@...dia.com>,
Saeed Mahameed <saeedm@...dia.com>,
Gal Pressman <gal@...dia.com>
Subject: [PATCH RESEND net] bonding: Fix extraction of ports from the packet headers
Wrong hash sends single stream to multiple output interfaces.
The nhoff parameter is relative to skb->head, so convert it to be
relative to skb->data for using in skb_flow_get_ports().
Fixes: a815bde56b15 ("net, bonding: Refactor bond_xmit_hash for use with xdp_buff")
Reviewed-by: Saeed Mahameed <saeedm@...dia.com>
Reviewed-by: Gal Pressman <gal@...dia.com>
Signed-off-by: Moshe Tal <moshet@...dia.com>
---
drivers/net/bonding/bond_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 07fc603c2fa7..3189bd14c664 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3745,7 +3745,8 @@ static bool bond_flow_ip(struct sk_buff *skb, struct flow_keys *fk, const void *
}
if (l34 && *ip_proto >= 0)
- fk->ports.ports = __skb_flow_get_ports(skb, *nhoff, *ip_proto, data, hlen);
+ /* nhoff is relative to skb->head instead of the usual skb->data */
+ fk->ports.ports = skb_flow_get_ports(skb, *nhoff - skb_headroom(skb), *ip_proto);
return true;
}
--
2.26.2
Powered by blists - more mailing lists