aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/af_inet.c
diff options
context:
space:
mode:
authorJesse Gross <jesse@kernel.org>2016-03-19 12:32:00 -0400
committerDavid S. Miller <davem@davemloft.net>2016-03-20 16:33:39 -0400
commitb8cba75bdf6a48ea4811bbefb11a94a5c7281b68 (patch)
treec97ea432d8acb82dd3261daea142aee6ef076bd0 /net/ipv4/af_inet.c
parent659e0bcaebc4ca36e64eac6e9f39c1904b17472c (diff)
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: 9667e9bb ("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>
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r--net/ipv4/af_inet.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 0cc923f83e10..965923325535 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1448,6 +1448,13 @@ out_unlock:
1448 return err; 1448 return err;
1449} 1449}
1450 1450
1451static 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
1451int inet_ctl_sock_create(struct sock **sk, unsigned short family, 1458int inet_ctl_sock_create(struct sock **sk, unsigned short family,
1452 unsigned short type, unsigned char protocol, 1459 unsigned short type, unsigned char protocol,
1453 struct net *net) 1460 struct net *net)
@@ -1676,7 +1683,7 @@ static const struct net_offload ipip_offload = {
1676 .callbacks = { 1683 .callbacks = {
1677 .gso_segment = inet_gso_segment, 1684 .gso_segment = inet_gso_segment,
1678 .gro_receive = inet_gro_receive, 1685 .gro_receive = inet_gro_receive,
1679 .gro_complete = inet_gro_complete, 1686 .gro_complete = ipip_gro_complete,
1680 }, 1687 },
1681}; 1688};
1682 1689