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

Implement --interface option for non-linux systems #529

Open
arriven opened this issue May 4, 2022 · 3 comments
Open

Implement --interface option for non-linux systems #529

arriven opened this issue May 4, 2022 · 3 comments

Comments

@arriven
Copy link
Owner

arriven commented May 4, 2022

--interface option uses syscall.BindToDevice which is only available for linux. It should be possible to use net.InterfaceByName inside conn.Control to get an addr that could then be transformed into sockaddr for regular syscall.Bind which is available for all unix systems. Doing it in the control function should be enough to not have troubles when network changes at runtime

@arriven
Copy link
Owner Author

arriven commented May 4, 2022

I think I've implemented it in 9fbca3f but it needs some additional testing

@deputinizer you were the one who initially requested the feature, can you check if this implementation has any issues compared to BindToDevice?

@arriven
Copy link
Owner Author

arriven commented May 5, 2022

Yeah, I'm not looking to implementing that on windows, just wanted to ensure that it works properly on unix without BindToDevice

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

No branches or pull requests

2 participants