Michael Stone wrote: > As a programmer you should be concerned with making sure that the packets go > in and out of the correct physical hardware. If the name doesn't relate to > the physical harder that's a harder problem to solve. You (and everyone > else) could reimplement that in software at a higher level, or accept that > this is something the OS should help with.
Maybe we should ask the OS to actually help, instead of "helping" us. For example, the OS knows when it is being installed. At install time, it could enumerate NICs and assign them permanent names based on the MAC addresses: eth0, eth1... At any subsequent boot, the OS could then continue to assign the same names. If a device appears to be missing, the name is skipped. eth3 doesn't become eth2, eth2 just goes missing for that boot. This is immensely useful in discovering when a NIC has suffered hardware damage or is otherwise not present. When an unrecognized device is plugged in, whether during runtime or at boot time, it gets the next sequential permanent name. Finally, a simple lookup table of MAC to name should be exposed by the kernel, and saved/loaded in the same way as firewall rules, so that people who want to change interface name assignments can do so cleanly. The one caveat is that a process which wants to change the MAC address of the NIC will have to signal that specifically, rather than just update the table. When the OS changes the MAC address, e.g. WiFi MAC randomization, it just updates the table because it knows what it is doing. All of this would be, I think, 999999% better than what we have now. -dsr-