From the getifaddrs(3) man page:
The getifaddrs() function creates a linked list of structures describing the network interfaces of the local system [...]
Does the order of this linked list imply a priority, and if so, what does this priority mean?
No, absolutely not. Routing is completely separate from that list. I'm not sure there's any document that asserts the negative "this is not priority order" (also it doesn't assert that it's sorted by anything else), but in my work using that list it definitely isn't in any priority order. It's just a list.
More importantly, if the documentation doesn't promise an order, then implementations are free to put it in any order they want (and free to change between releases), so you couldn't rely on it even if it were in some useful order on one platform.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With