Support IP/IPv6 options building on TX path - #61
Open
lxin wants to merge 1 commit into
Open
Conversation
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>
mustikka10
approved these changes
Apr 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.