Really? It works for me. You mean boot with no link, or what? I did that, and if_nameindex still returned eth0.
Right. if_nameindex does not return eth0 if I boot up without an ethernet connection. Maybe this is a system dependent thing? I am running on a RH8 based system.
The if_nameindex code looked a little nicer, but a loop on if_indextoname() is not so bad.
- mo