ip6_rcv_core() sets transport_header just past the fixed IPv6 header, and local input advances it over each extension header. Forwarding skips that walk, so a GSO packet with a destination options or routing header reaches ip6_forward() with transport_header at an extension header. So does a packet forwarded again after the router processed its routing header. skb_gso_validate_network_len() then reads a bogus TCP header length. An overestimate makes ip6_forward() answer with Packet Too Big at the current MTU, and the flow stalls. Since commit 7fb4c1967011 ("net: pull headers in qdisc_pkt_len_segs_init()"), a bogus doff below 5 also makes __dev_queue_xmit() drop the packet as SKB_BAD_GSO. Before the MTU check, set transport_header from csum_start for CHECKSUM_PARTIAL packets without encapsulation. Otherwise, if the packet has extension headers, skip them with ipv6_skip_exthdr(). Signed-off-by: Matt Vollrath --- The Packet Too Big stall dates back to commit fe6cc55f3a9a ("net: ip, ipv6: handle gso skbs in forwarding path"). --- net/ipv6/ip6_output.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 25fe0ba98b1a..60ac56afbd06 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -662,6 +662,23 @@ int ip6_forward(struct sk_buff *skb) __IP6_INC_STATS(net, ip6_dst_idev(dst), IPSTATS_MIB_OUTFORWDATAGRAMS); + if (skb_is_gso(skb)) { + if (skb->ip_summed == CHECKSUM_PARTIAL && !skb->encapsulation) { + skb_set_transport_header(skb, + skb_checksum_start_offset(skb)); + } else if (ipv6_ext_hdr(hdr->nexthdr)) { + u8 nexthdr = hdr->nexthdr; + __be16 frag_off; + int thoff; + + thoff = ipv6_skip_exthdr(skb, skb_network_offset(skb) + + sizeof(*hdr), &nexthdr, + &frag_off); + if (thoff >= 0) + skb_set_transport_header(skb, thoff); + } + } + mtu = ip6_dst_mtu_maybe_forward(dst, true); if (mtu < IPV6_MIN_MTU) mtu = IPV6_MIN_MTU; -- 2.43.0