Skip to content

Commit b8cba75

Browse files
jessegrossdavem330
authored andcommitted
ipip: Properly mark ipip GRO packets as encapsulated.
ipip encapsulated packets can be merged together by GRO but the result does not have the proper GSO type set or even marked as being encapsulated at all. Later retransmission of these packets will likely fail if the device does not support ipip offloads. This is similar to the issue resolved in IPv6 sit in feec0cb3 ("ipv6: gro: support sit protocol"). Reported-by: Patrick Boutilier <boutilpj@ednet.ns.ca> Fixes: 9667e9b ("ipip: Add gro callbacks to ipip offload") Tested-by: Patrick Boutilier <boutilpj@ednet.ns.ca> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Jesse Gross <jesse@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 659e0bc commit b8cba75

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

net/ipv4/af_inet.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1448,6 +1448,13 @@ static int inet_gro_complete(struct sk_buff *skb, int nhoff)
14481448
return err;
14491449
}
14501450

1451+
static int ipip_gro_complete(struct sk_buff *skb, int nhoff)
1452+
{
1453+
skb->encapsulation = 1;
1454+
skb_shinfo(skb)->gso_type |= SKB_GSO_IPIP;
1455+
return inet_gro_complete(skb, nhoff);
1456+
}
1457+
14511458
int inet_ctl_sock_create(struct sock **sk, unsigned short family,
14521459
unsigned short type, unsigned char protocol,
14531460
struct net *net)
@@ -1676,7 +1683,7 @@ static const struct net_offload ipip_offload = {
16761683
.callbacks = {
16771684
.gso_segment = inet_gso_segment,
16781685
.gro_receive = inet_gro_receive,
1679-
.gro_complete = inet_gro_complete,
1686+
.gro_complete = ipip_gro_complete,
16801687
},
16811688
};
16821689

0 commit comments

Comments
 (0)