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

fix: Allow port forwards to also bind IPv6 addresses #1538

Closed
wants to merge 2 commits into from

Conversation

heyvito
Copy link

@heyvito heyvito commented May 14, 2023

Hey folks!

Yesterday I hit a weird case in which an application managed to bind to the same port Lima should be using. With the kind help from folks on CNCF's #lima Slack channel, I understood that Lima was binding to IPv4, and the other application to IPv6.

I confirmed those changes fixed the behaviour on my machines (M1/Intel both running the latest stable macOS version). Also go test passes, and make lint complains of code unrelated to this PR. However, I'm not really sure how to test those changes further, and couldn't find instructions on how to do so. That said, maintainers, could you kindly take a look and provide further information on how to correctly test those changes?

I'll keep this as a draft until we have tests. Thanks!

@jandubois
Copy link
Member

jandubois commented May 15, 2023

I do not understand what you are trying to achieve with this change.

The code looks like you are trying to add a second default rule to forward all connections from 127.0.0.1 inside the guest to both 127.0.0.1 and ::1 on the host.

That is not how the portforwarding mechanism works: it stops at the first rule that matches the guest portion, and then forwards to the requested host port.

There is currently no mechanism for forwarding a single guest port to multiple host ports. Can you please file an issue first, so we can discuss the requirements first?

If we want to implement dualstack support, then is should be generalized so it can be applied to any forwarding rule, and not just the fallback default rule.

@heyvito
Copy link
Author

heyvito commented May 15, 2023

Hey @jandubois, thank you for taking some time to review this. I apologise if I made any kind of confusion here; I'll close this PR and file an issue instead.

@heyvito heyvito closed this May 15, 2023
@heyvito heyvito deleted the feat/ipv6 branch May 15, 2023 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants