Skip to content

Commit

Permalink
ipip: Properly mark ipip GRO packets as encapsulated.
Browse files Browse the repository at this point in the history
[ Upstream commit b8cba75 ]

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 feec0cb
("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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
  • Loading branch information
Jesse Gross authored and Sasha Levin committed Jan 15, 2017
1 parent a861b92 commit bd73bf4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion net/ipv4/af_inet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,13 @@ static int inet_gro_complete(struct sk_buff *skb, int nhoff)
return err;
}

static int ipip_gro_complete(struct sk_buff *skb, int nhoff)
{
skb->encapsulation = 1;
skb_shinfo(skb)->gso_type |= SKB_GSO_IPIP;
return inet_gro_complete(skb, nhoff);
}

int inet_ctl_sock_create(struct sock **sk, unsigned short family,
unsigned short type, unsigned char protocol,
struct net *net)
Expand Down Expand Up @@ -1650,7 +1657,7 @@ static const struct net_offload ipip_offload = {
.callbacks = {
.gso_segment = inet_gso_segment,
.gro_receive = inet_gro_receive,
.gro_complete = inet_gro_complete,
.gro_complete = ipip_gro_complete,
},
};

Expand Down

0 comments on commit bd73bf4

Please sign in to comment.