Better server failure detection and PreserveSourceIPPortWhenDestNATMa…#3648
Merged
xiaokangwang merged 2 commits intov2fly:masterfrom Mar 10, 2026
Conversation
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.
(Machine Generated)
This pull request introduces improvements to the NAT mapping behavior tests in
common/natTraversal/stun/natTypeTest.go. The main focus is on increasing the reliability of the mapping behavior test by validating the distinctness of test endpoints and refining the logic for determining whether source IP and port are preserved during NAT traversal.Validation improvements for mapping behavior:
OTHER-ADDRESSfrom the STUN server differs from the primary server in both IP and port, preventing false positives in mapping behavior tests.Refined NAT mapping detection logic:
CalcReminderValuesmethod to prioritize using theRESPONSE-ORIGINattribute for detecting preservation of source IP and port, falling back to hairpin detection only ifRESPONSE-ORIGINis unavailable. This improves accuracy in determining NAT mapping characteristics.RESPONSE-ORIGINis not present, ensuring the NAT mapping result is set appropriately.…