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 name_to_index() & index_to_name() #972

Merged
merged 2 commits into from
Jan 11, 2024

Conversation

arctic-alpaca
Copy link
Contributor

This adds the name_to_index() and index_to_name() methods. They are basically wrappers around ioctl calls described here. The relevant code in glibc can be found here for name_to_index() and here for index_to_name().

The tests pass locally but I'm not sure whether lo and /sys/class/net/lo/ifindex are universal enough to consider them acceptable for tests.

@arctic-alpaca arctic-alpaca marked this pull request as draft December 10, 2023 14:45
@arctic-alpaca arctic-alpaca marked this pull request as ready for review December 10, 2023 20:04
src/net/mod.rs Outdated Show resolved Hide resolved
src/net/netdevice.rs Outdated Show resolved Hide resolved
src/backend/libc/net/netdevice.rs Outdated Show resolved Hide resolved
@arctic-alpaca
Copy link
Contributor Author

arctic-alpaca commented Dec 19, 2023

Android support is blocked on rust-lang/libc#3487 and its release in libc.

@arctic-alpaca arctic-alpaca force-pushed the main branch 3 times, most recently from bcb8739 to ff23a3d Compare January 11, 2024 07:15
@arctic-alpaca
Copy link
Contributor Author

Nightly added a new dead code warning.

The Dragonfly CI failure seem to stem from this change in libc. According to the docs linked by rustix::time::clock_settime and rustix::time::clock_gettime, Dragonfly does not support CLOCK_BOOTTIME. How should that be fixed?

@sunfishcode
Copy link
Member

I've now fixed the DragonFly issue in #981.

@arctic-alpaca
Copy link
Contributor Author

Thanks! I removed the dead code commit since you also already handled that. With CI being green, this PR should hopefully be done now.

@sunfishcode sunfishcode merged commit e460984 into bytecodealliance:main Jan 11, 2024
44 checks passed
@sunfishcode
Copy link
Member

Thanks!

@sunfishcode
Copy link
Member

This is released in rustix 0.38.29.

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