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

Workaround XNU bug in getifaddrs netmasks #1788

Merged
merged 2 commits into from Nov 29, 2022

Conversation

roblabla
Copy link
Contributor

Fixes #1709

@roblabla roblabla force-pushed the workaround-xnu-bug-getifaddrs branch from c785f03 to c680f93 Compare August 10, 2022 15:07
src/ifaddrs.rs Outdated Show resolved Hide resolved
src/ifaddrs.rs Outdated Show resolved Hide resolved
src/ifaddrs.rs Outdated Show resolved Hide resolved
src/ifaddrs.rs Outdated Show resolved Hide resolved
@roblabla
Copy link
Contributor Author

CI breakage seems unrelated to my MR (looks like the latest serde release broke compatibility with the version of rustc/cargo used by CI).

@roblabla roblabla force-pushed the workaround-xnu-bug-getifaddrs branch from c680f93 to 8689956 Compare August 10, 2022 15:20
src/ifaddrs.rs Outdated Show resolved Hide resolved
@roblabla roblabla force-pushed the workaround-xnu-bug-getifaddrs branch from 8689956 to fd0a878 Compare August 10, 2022 15:49
@asomers
Copy link
Member

asomers commented Aug 11, 2022

CI breakage seems unrelated to my MR (looks like the latest serde release broke compatibility with the version of rustc/cargo used by CI).

The CI breakage was due to a Cargo bug that has since been fixed. However, serde needs to yank their most recent release and publish a new one before things will work again. serde-rs/serde#2255 .

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

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

It really sticks in my craw that we have to do this, but I guess we do. We can't fix OSX. Don't forget to add a CHANGELOG entry.

src/ifaddrs.rs Outdated Show resolved Hide resolved
src/ifaddrs.rs Outdated Show resolved Hide resolved
src/ifaddrs.rs Outdated Show resolved Hide resolved
src/ifaddrs.rs Show resolved Hide resolved
src/ifaddrs.rs Show resolved Hide resolved
@asomers
Copy link
Member

asomers commented Aug 12, 2022

Rebasing will fix ci

@roblabla roblabla force-pushed the workaround-xnu-bug-getifaddrs branch 2 times, most recently from 8d0ad34 to 9a05de5 Compare September 7, 2022 11:47
@roblabla
Copy link
Contributor Author

roblabla commented Sep 7, 2022

I rewrote the workaround to be safer - at least, I think it's safer. It now copies the data to a new zeroed sockaddr_storage.

@roblabla roblabla force-pushed the workaround-xnu-bug-getifaddrs branch from 9a05de5 to b017f1c Compare September 7, 2022 13:19
@roblabla
Copy link
Contributor Author

Bump. This has been used in prod for a little while, and is, as far as I can tell, sound.

@asomers
Copy link
Member

asomers commented Nov 19, 2022

@roblabla you still need to rebase this, both to fix CI and to fix the conflict.

@roblabla roblabla force-pushed the workaround-xnu-bug-getifaddrs branch 3 times, most recently from b0c1eb6 to 2accd76 Compare November 20, 2022 13:03
@asomers
Copy link
Member

asomers commented Nov 20, 2022

Looks good, but still needs a CHANGELOG entry.

@roblabla roblabla force-pushed the workaround-xnu-bug-getifaddrs branch from 2accd76 to 16f8ff9 Compare November 20, 2022 16:16
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

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

bors r+

@bors bors bot merged commit 5db5581 into nix-rust:master Nov 29, 2022
@asomers asomers mentioned this pull request Nov 29, 2022
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.

SockaddrStorage::as_sockaddr_in incorrectly returns None sometime
3 participants