Skip to content

fix: make RTM_GETLINK return interfaces sorted by index#12919

Open
iTrooz wants to merge 1 commit intogoogle:masterfrom
iTrooz:iface_index
Open

fix: make RTM_GETLINK return interfaces sorted by index#12919
iTrooz wants to merge 1 commit intogoogle:masterfrom
iTrooz:iface_index

Conversation

@iTrooz
Copy link
Copy Markdown

@iTrooz iTrooz commented Apr 10, 2026

See & Fix #12885

@google-cla
Copy link
Copy Markdown

google-cla bot commented Apr 10, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@milantracy
Copy link
Copy Markdown
Contributor

RTM_GETLINK (when used with the NLM_F_DUMP flag) does not guarantee that interfaces are returned in numerical order by index

@EtiennePerot
Copy link
Copy Markdown
Collaborator

Yes, but if that's what it does in Linux then gVisor should have the same effective behavior.
What order does Linux use?

@iTrooz
Copy link
Copy Markdown
Author

iTrooz commented Apr 10, 2026

RTM_GETLINK (when used with the NLM_F_DUMP flag) does not guarantee that interfaces are returned in numerical order by index

Agreed, but Linux (tested with 6.19.10-arch1-1) currently has this behavior, and I've personally never seen ip a interfaces change orders dynamically, except in gVisor. That's why I think this change is an improvement

What order does Linux use?

RTM_GETLINK seems to always return interfaces sorted by index

@ayushr2 ayushr2 requested a review from nybidari April 11, 2026 02:51
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.

Interfaces listing is not stable

3 participants