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

Socket::bind_device_by_index_{v4,v6} should be available on illumos/Solaris #560

Open
hawkw opened this issue Feb 26, 2025 · 0 comments · May be fixed by #561
Open

Socket::bind_device_by_index_{v4,v6} should be available on illumos/Solaris #560

hawkw opened this issue Feb 26, 2025 · 0 comments · May be fixed by #561

Comments

@hawkw
Copy link

hawkw commented Feb 26, 2025

The Socket::bind_device_by_index_v4 and Socket::bind_device_by_index_v6 functions wrap the socket option IP_BOUND_IF. Presently, these functions have the following cfg attribute:

    #[cfg(all(
        feature = "all",
        any(
            target_os = "ios",
            target_os = "visionos",
            target_os = "macos",
            target_os = "tvos",
            target_os = "watchos",
        )
    ))]

This means that these methods are only available on macOS-like systems. However, the IP_BOUND_IF socket option also exists on SunOS-derived systems (e.g. illumos and Solaris); see for instance the Solaris man page for ip(7p). We should change the list of systems that these methods are available on so that they also exist on these systems.

hawkw added a commit to hawkw/socket2-rs that referenced this issue Feb 26, 2025
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
@hawkw hawkw linked a pull request Feb 26, 2025 that will close this issue
hawkw added a commit to hawkw/socket2-rs that referenced this issue Feb 26, 2025
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
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 a pull request may close this issue.

1 participant