Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow generating candidates for both local and external addresses #631

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

streamer45
Copy link

Description

PR makes some changes to externalIPMapper in 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 findExternalIP methods to findExternalIPs and 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

@streamer45
Copy link
Author

@cnderrauber @stv0g Not urgent but would love your feedback if you have a chance to look at this. Thank you!

/cc @Sean-Der

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant