LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

[PATCH nf v2 0/3] ipvs: use parsed transport offsets in state handlers

To: netdev@xxxxxxxxxxxxxxx
Subject: [PATCH nf v2 0/3] ipvs: use parsed transport offsets in state handlers
Cc: coreteam@xxxxxxxxxxxxx, davem@xxxxxxxxxxxxx, edumazet@xxxxxxxxxx, fengxw06@xxxxxxx, fw@xxxxxxxxx, horms@xxxxxxxxxxxx, ja@xxxxxx, kuba@xxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, lvs-devel@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, pabeni@xxxxxxxxxx, pablo@xxxxxxxxxxxxx, phil@xxxxxx, qli01@xxxxxxxxxxxxxxx, stable@xxxxxxxxxxxxxxx, wangao@xxxxxxxxxx, xuke@xxxxxxxxxxxxxxx, yangyx22@xxxxxxxxxxxxxxxxxxxxx, Yizhou Zhao <zhaoyz24@xxxxxxxxxxxxxxxxxxxxx>
From: Yizhou Zhao <zhaoyz24@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 6 Jul 2026 18:16:21 +0800
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(-)

-- 
2.34.1



<Prev in Thread] Current Thread [Next in Thread>