fix(net): route native IPv6 output across interfaces - #2321
Merged
fslongjin merged 2 commits intoSep 22, 2026
Merged
Conversation
Use the namespace FIB and socket device constraint for native IPv6 output instead of implicitly transmitting on the SocketSet owner. Keep the owner stable and hand incoming local IPv6 packets to it while preserving the physical ingress interface. Generalize the existing bounded output and neighbor retry queues to complete IP addresses, including a full-width Patricia key and opaque route context. Activate configured-neighbor routing for both families and preserve existing IPv4 behavior. Use the selected egress MTU for TCP segmentation through smoltcp 4cfe0dd, keep NDP on the receiving link, and reject unsupported oversized native IPv6 UDP output before enqueueing. Validate fixed-source routes before changing TCP state. Add seven dunitest cases covering bidirectional cross-interface traffic, device constraints, 8192-byte TCP over MTU 1280, cold NDP, MTU-sized UDP, retry after ENETUNREACH, and global-source neighbor advertisements. Register them in whitelist and no_skip. Validation: make fmt and make kernel passed using the public dependency revision; Linux reference 21/21, DragonOS repeated focused tests 70/70 and existing networking regressions 161/161 passed. Real nginx IPv6 upstream proxy, dual-stack HTTP and graceful exit passed. IPv6 source fragmentation, PMTU socket options and full scope-id support remain outside this change. Signed-off-by: longjin <longjin@dragonos.org>
Member
Author
|
@codex review |
Update the manifest and lockfile to afde7359455a5b9feacd2b8684994232acbf8903 after smoltcp PR DragonOS-Community#32 merged into dragonos/v0.12.0. Verified that the merged commit has the same Git tree as the previously validated 4cfe0dd revision. No protocol implementation changes are introduced. make kernel passed with the merged dependency. Signed-off-by: longjin <longjin@dragonos.org>
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.
Summary
Fix native IPv6 local traffic when the source address / TCP SocketSet owner and the namespace-selected output interface differ.
Dependency
DragonOS-Community/smoltcp#32 has merged into
dragonos/v0.12.0. The manifest and lockfile now pin merged commitafde7359455a5b9feacd2b8684994232acbf8903. Its Git tree is identical to the previously validated4cfe0ddadd6c0f5a82a72245bf18c4df6f4bb8fd, so this follow-up changes dependency identity only.make kernelpassed again using the merged revision. The guest results below were obtained from the identical source tree before the revision-only update, not rerun for that update.Root cause
The FIB already supported IPv6, but output classification forced native-owner transmission; queued next hops and the explicit-next-hop transmit API were IPv4-only. Cross-interface local IPv6 replies were also not handed to the owner. Using the owner's MTU prevented reliable large transfers through a smaller actual egress.
NDP needs special link semantics: a unicast advertisement may target a global address, so multicast checks alone are insufficient. The dependency fixes both the external override and the internal second route lookup for typed NDP.
Validation
make fmt,make kernelwith public dependency revisionIndependent logic, security/concurrency and system/performance reviews completed; their actionable NDP finding was corrected and covered by library and guest regression tests.
Boundaries
This is host output/local delivery, not IPv6 router forwarding or NAT. Full scope-id and source-selection semantics are not added. Native IPv6 source fragmentation and
IPV6_MTU_DISCOVERremain unsupported: oversized non-local UDP is rejected synchronously withEMSGSIZE, verified separately, rather than claimed to match Linux's default fragmentation behavior. The shared UDP regression tests the common MTU-sized behavior.The nginx check uses a controlled single-worker configuration and a synthetic wire-level TCP/HTTP upstream. It is not an all-module nginx certification. Full repository CI remains to run.