Hello,
On Mon, 6 Jul 2026, Yizhou Zhao wrote:
> IPVS parses packets into struct ip_vs_iphdr before scheduling and state
> handling. For IPv6, iph.len contains the real transport-header offset
> after ipv6_find_hdr() has skipped any extension headers.
>
> TCP and SCTP state handlers still recompute their own transport offsets.
> They use sizeof(struct ipv6hdr) for IPv6, so packets with extension
> headers make the state machines read the wrong bytes.
>
> Pass the parsed transport offset through the common IPVS state handling
> callback, then use it in the TCP and SCTP state lookups.
>
> Changes in v2:
> - Pass the parsed transport offset through ip_vs_set_state() and the
> protocol callbacks.
> - Fix TCP state handling as well as SCTP.
> - Avoid reparsing the skb in SCTP state handling.
> - Split the common plumbing, TCP fix and SCTP fix into a 3-patch series.
>
> Yizhou Zhao (3):
> ipvs: pass parsed transport offset to state handlers
> ipvs: use parsed transport offset in TCP state lookup
> ipvs: use parsed transport offset in SCTP state lookup
>
> include/net/ip_vs.h | 3 ++-
> net/netfilter/ipvs/ip_vs_core.c | 10 +++++-----
> net/netfilter/ipvs/ip_vs_proto_sctp.c | 18 +++++++-----------
> net/netfilter/ipvs/ip_vs_proto_tcp.c | 11 +++--------
> net/netfilter/ipvs/ip_vs_proto_udp.c | 3 ++-
> 5 files changed, 19 insertions(+), 26 deletions(-)
The patchset looks good to me, thanks!
Acked-by: Julian Anastasov <[email protected]>
The Sashiko comments need additional fixes:
https://sashiko.dev/#/patchset/20260706101624.69471-1-zhaoyz24%40mails.tsinghua.edu.cn
Regards
--
Julian Anastasov <[email protected]>