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 --- 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