Skip to content

Commit 6a55368

Browse files
Alexander Duyckdavem330
authored andcommitted
ip6_gre: Do not allow segmentation offloads GRE_CSUM is enabled with FOU/GUE
This patch addresses the same issue we had for IPv4 where enabling GRE with an inner checksum cannot be supported with FOU/GUE due to the fact that they will jump past the GRE header at it is treated like a tunnel header. Signed-off-by: Alexander Duyck <aduyck@mirantis.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9a0351d commit 6a55368

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

net/ipv6/ip6_gre.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,11 +1355,15 @@ static int ip6gre_newlink(struct net *src_net, struct net_device *dev,
13551355
dev->hw_features |= GRE6_FEATURES;
13561356

13571357
if (!(nt->parms.o_flags & TUNNEL_SEQ)) {
1358-
/* TCP segmentation offload is not supported when we
1359-
* generate output sequences.
1358+
/* TCP offload with GRE SEQ is not supported, nor
1359+
* can we support 2 levels of outer headers requiring
1360+
* an update.
13601361
*/
1361-
dev->features |= NETIF_F_GSO_SOFTWARE;
1362-
dev->hw_features |= NETIF_F_GSO_SOFTWARE;
1362+
if (!(nt->parms.o_flags & TUNNEL_CSUM) ||
1363+
(nt->encap.type == TUNNEL_ENCAP_NONE)) {
1364+
dev->features |= NETIF_F_GSO_SOFTWARE;
1365+
dev->hw_features |= NETIF_F_GSO_SOFTWARE;
1366+
}
13631367

13641368
/* Can use a lockless transmit, unless we generate
13651369
* output sequences

0 commit comments

Comments
 (0)