public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
* [PATCH RESEND net] bonding: Fix extraction of ports from the packet headers
@ 2022-01-10  8:15 Moshe Tal
  2022-01-11 13:23 ` Jussi Maki
  0 siblings, 1 reply; 2+ messages in thread
From: Moshe Tal @ 2022-01-10  8:15 UTC (permalink / raw)
  To: Jay Vosburgh, Veaceslav Falico, Andy Gospodarek, David S . Miller,
	Jakub Kicinski
  Cc: netdev, Jussi Maki, Daniel Borkmann, Tariq Toukan, Moshe Tal,
	Saeed Mahameed, Gal Pressman

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@nvidia•com>
Reviewed-by: Gal Pressman <gal@nvidia•com>
Signed-off-by: Moshe Tal <moshet@nvidia•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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-11 13:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-10  8:15 [PATCH RESEND net] bonding: Fix extraction of ports from the packet headers Moshe Tal
2022-01-11 13:23 ` Jussi Maki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox