In inline mode, seg6_do_srh() leaves transport_header at the inserted SRH, although the L4 header has not moved. GSO length checks then read the SRH as TCP, and since commit 7fb4c1967011 ("net: pull headers in qdisc_pkt_len_segs_init()"), a bogus doff below 5 there makes __dev_queue_xmit() drop each GSO packet of the flow as SKB_BAD_GSO. On output, restore transport_header from its distance to the end of the packet, which the insertion does not change. The input path keeps it at the SRH, where local input parses extension headers from. Signed-off-by: Matt Vollrath --- transport_header has pointed at the inserted SRH since commit 6c8702c60b88 ("ipv6: sr: add support for SRH encapsulation and injection with lwtunnels"), where qdisc length accounting and ndo_features_check() read it. --- net/ipv6/seg6_iptunnel.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/net/ipv6/seg6_iptunnel.c b/net/ipv6/seg6_iptunnel.c index 0d39a38a5dd2..942704eca8db 100644 --- a/net/ipv6/seg6_iptunnel.c +++ b/net/ipv6/seg6_iptunnel.c @@ -676,6 +676,7 @@ static int seg6_output_core(struct net *net, struct sock *sk, struct dst_entry *orig_dst = skb_dst(skb); struct dst_entry *dst = NULL; struct seg6_lwt *slwt; + int tail_len = -1; int err; slwt = seg6_lwt_lwtunnel(orig_dst->lwtstate); @@ -684,10 +685,17 @@ static int seg6_output_core(struct net *net, struct sock *sk, dst = dst_cache_get(&slwt->cache_output); local_bh_enable(); + if (slwt->tuninfo->mode == SEG6_IPTUN_MODE_INLINE && + skb_transport_header_was_set(skb)) + tail_len = skb->len - skb_transport_offset(skb); + err = seg6_do_srh(skb, dst); if (unlikely(err)) goto drop; + if (tail_len >= 0) + skb_set_transport_header(skb, skb->len - tail_len); + if (unlikely(!dst)) { struct ipv6hdr *hdr = ipv6_hdr(skb); struct flowi6 fl6; -- 2.43.0