From: Matt Vollrath <tactii@gmail.com>
To: netdev@vger.kernel.org, "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Simon Horman <horms@kernel.org>, David Ahern <dsahern@kernel.org>,
Ido Schimmel <idosch@nvidia.com>,
Andrea Mayer <andrea.mayer@uniroma2.it>,
Justin Iurman <justin.iurman@gmail.com>,
Alexander Aring <aahringo@redhat.com>,
Willem de Bruijn <willemb@google.com>,
Alexander Duyck <alexander.duyck@gmail.com>
Subject: [PATCH net-next 2/4] ipv6: sr: keep transport header after inline SRH insertion
Date: Thu, 5 Nov 2026 15:13:07 -0500 [thread overview]
Message-ID: <20261105201309.3182307-3-tactii@gmail.com> (raw)
In-Reply-To: <20261105201309.3182307-1-tactii@gmail.com>
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 <tactii@gmail.com>
---
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
next prev parent reply other threads:[~2026-11-05 20:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 20:13 [PATCH net-next 0/4] ipv6: fix stale transport header of GSO packets with extension headers Matt Vollrath
2026-11-05 20:13 ` [PATCH net-next 1/4] ipv6: fix transport header of forwarded GSO packets Matt Vollrath
2026-11-05 20:13 ` Matt Vollrath [this message]
2026-11-05 20:13 ` [PATCH net-next 3/4] ipv6: rpl: keep transport header after SRH insertion Matt Vollrath
2026-11-05 20:13 ` [PATCH net-next 4/4] ipv6: ioam: keep transport header after inline insertion Matt Vollrath
2026-11-05 20:17 ` [PATCH net-next 0/4] ipv6: fix stale transport header of GSO packets with extension headers netdev-bot+sinfo
2026-11-05 20:26 ` Matt Vollrath
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261105201309.3182307-3-tactii@gmail.com \
--to=tactii@gmail.com \
--cc=aahringo@redhat.com \
--cc=alexander.duyck@gmail.com \
--cc=andrea.mayer@uniroma2.it \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=justin.iurman@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox