Skip to content

Commit 3d7b332

Browse files
shorman-netronomedavem330
authored andcommitted
gre: set inner_protocol on xmit
Ensure that the inner_protocol is set on transmit so that GSO segmentation, which relies on that field, works correctly. This is achieved by setting the inner_protocol in gre_build_header rather than each caller of that function. It ensures that the inner_protocol is set when gre_fb_xmit() is used to transmit GRE which was not previously the case. I have observed this is not the case when OvS transmits GRE using lwtunnel metadata (which it always does). Fixes: 3872035 ("gre: Use inner_proto to obtain inner header protocol") Cc: Pravin Shelar <pshelar@ovn.org> Acked-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Acked-by: Pravin B Shelar <pshelar@ovn.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5e45789 commit 3d7b332

File tree

3 files changed

+1
-3
lines changed

3 files changed

+1
-3
lines changed

include/net/gre.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ static inline void gre_build_header(struct sk_buff *skb, int hdr_len,
104104

105105
skb_push(skb, hdr_len);
106106

107+
skb_set_inner_protocol(skb, proto);
107108
skb_reset_transport_header(skb);
108109
greh = (struct gre_base_hdr *)skb->data;
109110
greh->flags = gre_tnl_flags_to_gre_flags(flags);

net/ipv4/ip_gre.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ static void __gre_xmit(struct sk_buff *skb, struct net_device *dev,
370370
tunnel->parms.o_flags, proto, tunnel->parms.o_key,
371371
htonl(tunnel->o_seqno));
372372

373-
skb_set_inner_protocol(skb, proto);
374373
ip_tunnel_xmit(skb, dev, tnl_params, tnl_params->protocol);
375374
}
376375

net/ipv6/ip6_gre.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,6 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb,
519519
gre_build_header(skb, tunnel->tun_hlen, tunnel->parms.o_flags,
520520
protocol, tunnel->parms.o_key, htonl(tunnel->o_seqno));
521521

522-
skb_set_inner_protocol(skb, protocol);
523-
524522
return ip6_tnl_xmit(skb, dev, dsfield, fl6, encap_limit, pmtu,
525523
NEXTHDR_GRE);
526524
}

0 commit comments

Comments
 (0)