Skip to content

Added bind_device_by_index_{v4,v6} for linux and android (#569) #572

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

boris-n
Copy link
Contributor

@boris-n boris-n commented Apr 22, 2025

No description provided.

@boris-n boris-n force-pushed the bind_device_by_index branch from f766329 to 931d818 Compare April 22, 2025 11:33
@boris-n boris-n force-pushed the bind_device_by_index branch from 931d818 to 5c81ff2 Compare April 22, 2025 11:50
@ningyuan-wang
Copy link

For Android and Linux, the syscalls are independent of the V4 or V6 stack used, therefore the function name should be bind_device_by_index, and not having the suffix attached.

Since setsockopt for SO_BINDTOIFINDEX is added, the corresponding getsockopt is also needed.

Android support required a bump to libc version: See 0.2.172 updates for libc.

PR 573 is created that resolves the issues listed.

@boris-n boris-n force-pushed the bind_device_by_index branch from 5c81ff2 to 4fc67a9 Compare April 25, 2025 12:37
@boris-n
Copy link
Contributor Author

boris-n commented Apr 25, 2025

For Android and Linux, the syscalls are independent of the V4 or V6 stack used, therefore the function name should be bind_device_by_index, and not having the suffix attached.

The question here is mainly if the socket2 library should provide an abstraction from the target OS (as far as possible) or provide a different set of functions for each target OS.

I leave it to the maintainers of the socket2 library to make this decision.

Since setsockopt for SO_BINDTOIFINDEX is added, the corresponding getsockopt is also needed.

Added. (Again, a decision from the socket2 maintainers is needed if this should be added to the existing device_index_{v4,v6} functions, or if a new, IP version independent function should be added for linux/android.

Android support required a bump to libc version: See 0.2.172 updates for libc.

Updated.

@boris-n
Copy link
Contributor Author

boris-n commented Apr 25, 2025

For Android and Linux, the syscalls are independent of the V4 or V6 stack used, therefore the function name should be bind_device_by_index, and not having the suffix attached.

The question here is if the socket2 library should provide functions which abstract from the target OS (as far as possible) or if it should provide target OS specific functions. I.e. do we want to have bind_device_by_index_{v4,v6} for some targets and bind_device_by_index for Linux/Android, or do we want to have a single set of functions for all target OSes.

I leave it to the maintainer of the socket2 library to make this decision.

Since setsockopt for SO_BINDTOIFINDEX is added, the corresponding getsockopt is also needed.

Added. (Same as above: A decision is needed if we want to have device_index_{v4,v6} functions for some target OS and device_index function for Linux/Android or if we want to have a single set of functions for all target OSes.)

Android support required a bump to libc version: See 0.2.172 updates for libc.

Updated.

@boris-n boris-n requested a review from Thomasdezeeuw April 25, 2025 12:44
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.

3 participants