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 std::net::SocketAddr to libc::sockaddr conversion. #54

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

mstyura
Copy link
Contributor

@mstyura mstyura commented Jul 31, 2024

This make SCNetworkReachabilityCreateWithAddressPair work with any valid pair of addresses, not only 0.0.0.0.
The fixed implementation is mostly taken from socket2


This change is Reviewable

@mstyura mstyura changed the title Fix SocketAddr to libc::sockaddr conversion. Fix std::net::SocketAddr to libc::sockaddr conversion. Jul 31, 2024
@mstyura
Copy link
Contributor Author

mstyura commented Aug 1, 2024

@dlon could you please review this PR, thanks a lot in advance!

@mstyura mstyura force-pushed the fix-sockaddr-to-c-conversion branch from ec2c0af to 13abe36 Compare August 1, 2024 08:10
@mstyura
Copy link
Contributor Author

mstyura commented Aug 12, 2024

@faern could you please take a look at this PR and merge if you are ok with changes? Thanks a lot in advance, Yury.

@faern
Copy link
Member

faern commented Aug 13, 2024

Hi. Sorry for the slow reply. It's still vacation period in Sweden and many developers are off. We'll get back to you once we have the manpower to handle third party PRs :) Thanks for contributing a fix!

@mstyura
Copy link
Contributor Author

mstyura commented Aug 13, 2024

Ok, no problem at all, have a great vacation!

Copy link
Member

@faern faern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had no idea we had a bug with this API 😮 I have to try it out locally and see. Apparently we have not really used this particular API much?

@mstyura mstyura force-pushed the fix-sockaddr-to-c-conversion branch from 13abe36 to 5f28321 Compare August 20, 2024 21:07
@faern faern merged commit 8cfff94 into mullvad:main Aug 21, 2024
faern added a commit that referenced this pull request Aug 21, 2024
Fix std::net::SocketAddr to libc::sockaddr conversion.
@faern
Copy link
Member

faern commented Aug 22, 2024

This fix has now been published, as part of 0.6.1: https://crates.io/crates/system-configuration/0.6.1

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