public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] net: huawei: hinic: correct IPv6 version check in TX checksum path
@ 2026-03-21 16:52 Alok Tiwari
  2026-03-21 16:52 ` [PATCH net-next 2/2] net: huawei: hinic3: " Alok Tiwari
  2026-03-23 17:11 ` [PATCH net-next 1/2] net: huawei: hinic: " Simon Horman
  0 siblings, 2 replies; 4+ messages in thread
From: Alok Tiwari @ 2026-03-21 16:52 UTC (permalink / raw)
  To: gongfan1, cai.huoqing, andrew+netdev, kuba, davem, edumazet,
	pabeni, horms, netdev
  Cc: alok.a.tiwarilinux, alok.a.tiwari

The TX checksum/offload code determines whether the network header is
IPv4 or IPv6 by checking the version field. The IPv6 case incorrectly
checked ip->v4->version for a value of 6. Use ip->v6->version instead to
match the header type being parsed.

Use ip->v6->version in the IPv6 case to match intent and improve
readability.

Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
---
 drivers/net/ethernet/huawei/hinic/hinic_tx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/huawei/hinic/hinic_tx.c b/drivers/net/ethernet/huawei/hinic/hinic_tx.c
index 9b60966736db..e26cdc3fc31b 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_tx.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_tx.c
@@ -209,7 +209,7 @@ static void get_inner_l3_l4_type(struct sk_buff *skb, union hinic_l3 *ip,
 			   IPV4_PKT_NO_CHKSUM_OFFLOAD :
 			   IPV4_PKT_WITH_CHKSUM_OFFLOAD;
 		*l4_proto = ip->v4->protocol;
-	} else if (ip->v4->version == 6) {
+	} else if (ip->v6->version == 6) {
 		*l3_type = IPV6_PKT;
 		exthdr = ip->hdr + sizeof(*ip->v6);
 		*l4_proto = ip->v6->nexthdr;
-- 
2.50.1


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

end of thread, other threads:[~2026-03-23 19:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-21 16:52 [PATCH net-next 1/2] net: huawei: hinic: correct IPv6 version check in TX checksum path Alok Tiwari
2026-03-21 16:52 ` [PATCH net-next 2/2] net: huawei: hinic3: " Alok Tiwari
2026-03-23 17:11 ` [PATCH net-next 1/2] net: huawei: hinic: " Simon Horman
2026-03-23 19:10   ` ALOK TIWARI

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