Skip to content

Commit e0b65f9

Browse files
westeridavem330
authored andcommitted
net: thunderbolt: Fix TCPv6 GSO checksum calculation
Alex reported that running ssh over IPv6 does not work with Thunderbolt/USB4 networking driver. The reason for that is that driver should call skb_is_gso() before calling skb_is_gso_v6(), and it should not return false after calculates the checksum successfully. This probably was a copy paste error from the original driver where it was done properly. Reported-by: Alex Balcanquall <[email protected]> Fixes: e69b6c0 ("net: Add support for networking over Thunderbolt cable") Cc: [email protected] Signed-off-by: Mika Westerberg <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 75ad80e commit e0b65f9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/net/thunderbolt/main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,12 +1049,11 @@ static bool tbnet_xmit_csum_and_map(struct tbnet *net, struct sk_buff *skb,
10491049
*tucso = ~csum_tcpudp_magic(ip_hdr(skb)->saddr,
10501050
ip_hdr(skb)->daddr, 0,
10511051
ip_hdr(skb)->protocol, 0);
1052-
} else if (skb_is_gso_v6(skb)) {
1052+
} else if (skb_is_gso(skb) && skb_is_gso_v6(skb)) {
10531053
tucso = dest + ((void *)&(tcp_hdr(skb)->check) - data);
10541054
*tucso = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
10551055
&ipv6_hdr(skb)->daddr, 0,
10561056
IPPROTO_TCP, 0);
1057-
return false;
10581057
} else if (protocol == htons(ETH_P_IPV6)) {
10591058
tucso = dest + skb_checksum_start_offset(skb) + skb->csum_offset;
10601059
*tucso = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,

0 commit comments

Comments
 (0)