-
Notifications
You must be signed in to change notification settings - Fork 250
Enable IP_BOUND_IF
on illumos and Solaris
#561
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
Enable IP_BOUND_IF
on illumos and Solaris
#561
Conversation
The `IP_BOUND_IF` socket option, which is wrapped by the `Socket::bind_device_by_index_{v4,v6}` and `Socket::device_index_{v4,v6}` is available on SunOS-like systems, such as illumos and Solaris, as well as macOS-like systems. However, these APIs are currently cfg-flagged to only be available on macOS-like systems. This commit changes the cfg attributes to also enable these APIs on illumos and Solaris. Fixes rust-lang#560
2928673
to
51e9773
Compare
Ugh, it looks like |
`libc` [v0.2.171] was just released, and it includes definitions of `IP_BOUND_IF` for Solarish operating systems. Thus, we can now remove the temporary local definitions. [v0.2.171]: https://github.com/rust-lang/libc/releases/tag/0.2.171
Thanks @hawkw |
@Thomasdezeeuw would it be possible to get a patch release of |
@hawkw yes, if you can create a pr to target 0.5.x that would be helpful 👍 |
The `IP_BOUND_IF` socket option, which is wrapped by the `Socket::bind_device_by_index_{v4,v6}` and `Socket::device_index_{v4,v6}` is available on SunOS-like systems, such as illumos and Solaris, as well as macOS-like systems. However, these APIs are currently cfg-flagged to only be available on macOS-like systems. This commit changes the cfg attributes to also enable these APIs on illumos and Solaris. Fixes rust-lang#560
The `IP_BOUND_IF` socket option, which is wrapped by the `Socket::bind_device_by_index_{v4,v6}` and `Socket::device_index_{v4,v6}` is available on SunOS-like systems, such as illumos and Solaris, as well as macOS-like systems. However, these APIs are currently cfg-flagged to only be available on macOS-like systems. This commit changes the cfg attributes to also enable these APIs on illumos and Solaris. Fixes #560
The `ClientBuilder` type has an `interface` method that sets the name of a specific network interface to bind TCP connections on. This method is currently only enabled on Linux, Android, and Fuchsia, as it uses the `SO_BINDTODEVICE` socket option, which only exists on those systems. Upstream changes to `socket2` (rust-lang/socket2#561) and `hyper-util` (hyperium/hyper-util#176) have added support for similar functionality on macOS (and other Apple operating systems, such as iOS, watchOS, tvOS, and visionOS), and Solaris and Solaris-like systems like illumos, using the `IP_BOUND_IF`/`IPV6_BOUND_IF` socket options on those systems. This branch enables the `ClientBuilder::interface` API on these additional target OSes. Note that this presently requires a Cargo patch to take a Git dependency on hyperium/hyper-util@5831ace. Once that commit is published, the patch can be removed. This PR should not be merged until then. Fixes seanmonstar#2571
The `ClientBuilder` type has an `interface` method that sets the name of a specific network interface to bind TCP connections on. This method is currently only enabled on Linux, Android, and Fuchsia, as it uses the `SO_BINDTODEVICE` socket option, which only exists on those systems. Upstream changes to `socket2` (rust-lang/socket2#561) and `hyper-util` (hyperium/hyper-util#176) have added support for similar functionality on macOS (and other Apple operating systems, such as iOS, watchOS, tvOS, and visionOS), and Solaris and Solaris-like systems like illumos, using the `IP_BOUND_IF`/`IPV6_BOUND_IF` socket options on those systems. This branch enables the `ClientBuilder::interface` API on these additional target OSes. Fixes #2571
The `IP_BOUND_IF` socket option, which is wrapped by the `Socket::bind_device_by_index_{v4,v6}` and `Socket::device_index_{v4,v6}` is available on SunOS-like systems, such as illumos and Solaris, as well as macOS-like systems. However, these APIs are currently cfg-flagged to only be available on macOS-like systems. This commit changes the cfg attributes to also enable these APIs on illumos and Solaris. Fixes rust-lang#560
The
IP_BOUND_IF
socket option, which is wrapped by theSocket::bind_device_by_index_{v4,v6}
andSocket::device_index_{v4,v6}
is available on SunOS-like systems, suchas illumos and Solaris, as well as macOS-like systems. However, these
APIs are currently cfg-flagged to only be available on macOS-like
systems.
This commit changes the cfg attributes to also enable these APIs on
illumos and Solaris.
Fixes #560