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

Add support for SockAddr::Link when receiving packets #1344

Merged

Conversation

internetionals
Copy link
Contributor

@internetionals internetionals commented Nov 27, 2020

fixes #1343

Copy link
Member

@asomers asomers left a comment

Looks pretty good. Let's just try adding fuchsia support.

CHANGELOG.md Outdated
@@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Added `mremap` (#[1306](https://github.com/nix-rust/nix/pull/1306))
### Changed
### Fixed
- Fixed calling `recvfrom` on an `AddrFamily::Packet` socket (#[1344](https://github.com/nix-rust/nix/pull/1344))
Copy link
Member

@asomers asomers Nov 27, 2020

Choose a reason for hiding this comment

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

Wrap to 80 cols, please.

Copy link
Contributor Author

@internetionals internetionals Dec 1, 2020

Choose a reason for hiding this comment

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

Done

@@ -1719,6 +1719,15 @@ pub fn sockaddr_storage_to_addr(
Ok(SockAddr::Unix(UnixAddr(sun, pathlen)))
}
#[cfg(any(target_os = "android", target_os = "linux"))]
Copy link
Member

@asomers asomers Nov 27, 2020

Choose a reason for hiding this comment

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

You can add fuchsia here.

Copy link
Member

@asomers asomers Nov 28, 2020

Choose a reason for hiding this comment

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

Err, wait on that. Fuchsia support hasn't merged yet.

Copy link
Contributor Author

@internetionals internetionals Dec 1, 2020

Choose a reason for hiding this comment

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

While the Fuchsia's libc (being a based on a Musl fork) has the defines and structures, I don't think it actually supports raw packet sockets (based on a cursory glance of it's own API) and that they're really just relics of the fork. But given that it's in their libc might be enough of a reason to support it.

@internetionals internetionals force-pushed the support_packet_socket_in_recvfrom branch from 52f5fd7 to 796a25f Compare Nov 29, 2020
@asomers
Copy link
Member

asomers commented Dec 2, 2020

I'm afraid you'll need to rebase to fix the CHANGELOG.

@internetionals internetionals force-pushed the support_packet_socket_in_recvfrom branch 2 times, most recently from 244f46f to 0191c5f Compare Dec 8, 2020
@internetionals internetionals force-pushed the support_packet_socket_in_recvfrom branch from 0191c5f to 867cb7d Compare Jan 4, 2021
@internetionals
Copy link
Contributor Author

internetionals commented Jan 11, 2021

@asomers is there anything left I can do to get this over the finish line?

Copy link
Member

@asomers asomers left a comment

Sorry I've been ignoring this. I don't have much time to work on Nix anymore. But the PR looks good now.

bors r+

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