-
Notifications
You must be signed in to change notification settings - Fork 249
Socket::bind_device_by_index_{v4,v6}
should be available on linux and android
#569
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
Comments
The initial investigation is incorrect: |
Pr to add support for this would be welcome. |
For Android and Linux, the syscalls are independent of the V4 or V6 stack used, therefore the function name should be PR 573 is created to support this issue. |
SO_BINDTOIFINDEX
has been added to linux since linux v5.1. It behaves similar toSO_BINDTODEVICE
but takes the interface index as argument. When a user-space program has the index of a network interface, Calling it directly avoids the possibility where the network device is renamed asynchronously after the program temporarily resolves the interface name from the interface index.Socket::bind_device_by_index{v4,v6}
currently is limited to macOS-like systems and solaris/illumos only. (See also issue #560 )While current implementation is not valid to linux, another implementation can be defined for linux guarded by
cfg
macro.Android also has support for
SO_BINDTODEVICE
, therefore the support can be extended to android target as well.The text was updated successfully, but these errors were encountered: