Allow generating candidates for both local and external addresses#631
Closed
streamer45 wants to merge 1 commit intopion:masterfrom
Closed
Allow generating candidates for both local and external addresses#631streamer45 wants to merge 1 commit intopion:masterfrom
streamer45 wants to merge 1 commit intopion:masterfrom
Conversation
Author
|
@cnderrauber @stv0g Not urgent but would love your feedback if you have a chance to look at this. Thank you! /cc @Sean-Der |
Member
|
Thank you, This issue is resolved in the new |
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.
Description
PR makes some changes to
externalIPMapperin order to allow us to generate an additional candidate for a local IP in case the same address is already mapped to an external one.Before this PR, a mapping such as
[]string{"EA/IA", "IA/IA"}would throw an error since the internal address appears twice. With this PR, that same mapping should be allowed and generate two candidates, one with the external address and one with the local address.To do this we are converting the
findExternalIPmethods tofindExternalIPsand return a slice which we iterate on. I tried to avoid changing the logic too much so the changes should be backwards compatible. That means that we are still allowing only one external IP for a given local IP.That said, I am not very experienced with this logic so I'd like to discuss with people more familiar with the code base whether the proposed changes make sense and if there could be edge cases in which this addition may not work as desired.
The original discussion along with a practical example can be found at https://gophers.slack.com/archives/CAK2124AG/p1701379410647329