Skip to content

Support IP/IPv6 options building on TX path - #61

Open
lxin wants to merge 1 commit into
mainfrom
ip-options
Open

Support IP/IPv6 options building on TX path#61
lxin wants to merge 1 commit into
mainfrom
ip-options

Conversation

@lxin

@lxin lxin commented Dec 13, 2025

Copy link
Copy Markdown
Owner

When users configure IP or IPv6 options via setsockopt(), the transmit path must reserve sufficient headroom to accommodate these options. This patch ensures that space is correctly reserved so IP/IPv6 options can be built during transmission.

Note that full IP/IPv6 options support on the TX path also requires corresponding changes in the UDP tunnel transmit code, see lxin/net-next: ip-options.

The QUIC stack currently assumes a fixed IPv4/IPv6 + UDP header size
when calculating the encapsulation length. This breaks when the socket
is configured with IPv4 IP options or IPv6 extension headers, as no
space is reserved for them in the skb headroom.

Add helpers to compute the encapsulation length based on the socket’s
IP options. For IPv4, include inet_sk(sk)->inet_opt if present. For
IPv6, include fragmentable and non-fragmentable extension header
lengths from inet6_sk(sk)->opt.

Update quic_encap_len() to take the socket as input and use the new
helpers, ensuring sufficient headroom is reserved before sending QUIC
packets.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants