LWN: Comments on "Char devices for network interfaces" https://lwn.net/Articles/356899/ This is a special feed containing comments posted to the individual LWN article titled "Char devices for network interfaces". en-us Fri, 24 Oct 2025 17:22:09 +0000 Fri, 24 Oct 2025 17:22:09 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Char devices for network interfaces https://lwn.net/Articles/359088/ https://lwn.net/Articles/359088/ mdomsch <div class="FormattedComment"> If I didn't think it was really a problem, I wouldn't have spent so much time trying to find ways to solve it cleanly. :-)<br> <p> By not changing how the kernel chooses to name devices, I can't break things for anyone. If they like the non-deterministic nature of device naming, and it works for them, great.<br> <p> But that 0.1% you refer to, is around 20% of Dell's server sales, likewise for other server companies. Not insignificant to that userbase.<br> <p> I'm not suggesting making this optional. I'm suggesting we add it into the base udev rules, where, if a platform provides additional information to help is provide "better" names, in addition to the normal kernel-provided names, that thsoe "better" names can be used too. For various definitions of "better", all simultaneously.<br> <p> Yes, other OSs have this same problem too. I get to discuss the problem and approaches at solutions with them also.<br> <p> <p> <p> </div> Wed, 28 Oct 2009 13:26:46 +0000 Char devices for network interfaces https://lwn.net/Articles/358934/ https://lwn.net/Articles/358934/ dlang <div class="FormattedComment"> unfortunately I see most of this work as being a solution in search of a problem.<br> <p> there are a handful of cases (USB devices) where simple detection order is non-determinant, but the vast majority of devices fall into two categories<br> <p> 1. a single interface<br> <p> 2. simple detection order produces reliable device numbering<br> <p> yes, when you change a card it can change the detection order, but that is true for every operating system, and is seldom a real big problem (because people are used to dealing with it)<br> <p> the attempts to solve this problem end up causing more grief for many people, so much so that I doubt if the solution is worth it.<br> <p> when you have a fairly rare problem to start with, your solution must be _very_ reliable for it to be better than doing nothing.<br> <p> if you have a problem that affect 0.1% of the population, and your solution has an error rate of 1%, you have made life worse for 0.9% of the population.<br> <p> this assumes that your solution is something that is deployed everywhere. creating a solution like this and having it option, used only in the case where people are experiencing problems to start with, you have a very different situation, then you are making life better for 0.099% of the population and not making life worse for anyone.<br> </div> Tue, 27 Oct 2009 19:18:01 +0000 Char devices for network interfaces https://lwn.net/Articles/358930/ https://lwn.net/Articles/358930/ mdomsch <div class="FormattedComment"> Thanks everyone for your comments here. Network device naming has been a recurring problem for several years, and I appreciate seeing that it's still a big problem for people. That helps provide the incentive to getting it fixed.<br> </div> Tue, 27 Oct 2009 18:54:20 +0000 Char devices for network interfaces https://lwn.net/Articles/358226/ https://lwn.net/Articles/358226/ jengelh <div class="FormattedComment"> You are supposed to truncate the file, not remove it. It's the only way the SHA check will work as intended, presuming that the udev files are also marked as %config(noreplace) in rpm.<br> </div> Thu, 22 Oct 2009 18:18:42 +0000 Char devices for network interfaces https://lwn.net/Articles/357340/ https://lwn.net/Articles/357340/ giraffedata <p>So this is just about keeping a directory of ifindexes? Character device special files seem like a pretty crazy implementation for that. How about a regular file that contains the ifindex? Or a single file that contains the whole directory? <p> And given that the comments indicate that udev is already capable of setting the name of the network interface, why doesn't the network interface name provide the desired mapping? Fri, 16 Oct 2009 18:59:50 +0000 Char devices for network interfaces https://lwn.net/Articles/357311/ https://lwn.net/Articles/357311/ nix <div class="FormattedComment"> Well, /lib/udev was already in use for other udev stuff which has to be runnable before /usr is mounted (e.g. /lib/udev/vol_id).<br> <p> But, yes, putting what damn well should be conffiles (as witness the fact that people want to change them, even if udev upstream is resistant) in /lib is demented.<br> <p> </div> Fri, 16 Oct 2009 16:15:11 +0000 Char devices for network interfaces https://lwn.net/Articles/357247/ https://lwn.net/Articles/357247/ pjones <div class="FormattedComment"> That doesn't really address the problem - when you boot the installer the first time, udev is basically randomly picking which one is which. This means that any setup an IT department needs to do elsewhere in the network relating to, for example, which port is which, can't be done until after installation - which may be too late.<br> </div> Fri, 16 Oct 2009 03:21:23 +0000 Char devices for network interfaces https://lwn.net/Articles/357243/ https://lwn.net/Articles/357243/ njs <div class="FormattedComment"> dpkg-divert --add --local /lib/udev/rules.d/75-persistent-net-generator.rules --divert /lib/udev/die-die-die --rename ?<br> <p> The use of /lib here does seem bizarre though.<br> </div> Fri, 16 Oct 2009 03:02:40 +0000 Char devices for network interfaces https://lwn.net/Articles/357214/ https://lwn.net/Articles/357214/ nix <div class="FormattedComment"> That was exactly my moan :)<br> <p> I'm not sure that creating an empty version of the net generator rule file <br> works, either: I'm not sure if udev replaces files named $FOO in /lib/udev <br> with files of the same name in /etc/udev/rules.d. NEWS says:<br> <p> <font class="QuotedText">&gt; It does not matter in which directory a rule file lives, all files are</font><br> <font class="QuotedText">&gt; sorted in lexical order.</font><br> <p> which could go either way.<br> </div> Thu, 15 Oct 2009 20:09:26 +0000 Char devices for network interfaces https://lwn.net/Articles/357213/ https://lwn.net/Articles/357213/ dlang <div class="FormattedComment"> which is why my current builds remove udev ;-)<br> </div> Thu, 15 Oct 2009 19:59:28 +0000 Char devices for network interfaces https://lwn.net/Articles/357212/ https://lwn.net/Articles/357212/ Cato <div class="FormattedComment"> That's nice but it doesn't really work for a large number of servers.<br> </div> Thu, 15 Oct 2009 19:47:34 +0000 Char devices for network interfaces https://lwn.net/Articles/357206/ https://lwn.net/Articles/357206/ joey <div class="FormattedComment"> Removing rules files would work fine if a) using dpkg and b) udev had left <br> its rules files as conffiles under /etc. This sort of situation is why dpkg <br> does not add back deleted conffiles on upgrade. But since udev's rules files <br> have moved to /lib/udev, deletion of rules files will no longer persist <br> across upgrades.<br> <p> Now it seems you'd have to create an empty version of the net generator rule <br> in /etc/udev to override the one from /lib/udev. <br> <p> Rather a mess.<br> </div> Thu, 15 Oct 2009 19:07:27 +0000 Char devices for network interfaces https://lwn.net/Articles/357203/ https://lwn.net/Articles/357203/ nix <div class="FormattedComment"> This of course is the downside of having this sort of thing in a set <br> of 'standard rules': it's hard to eliminate them without hacking udev <br> before installation :/<br> <p> </div> Thu, 15 Oct 2009 18:54:20 +0000 Char devices for network interfaces https://lwn.net/Articles/357188/ https://lwn.net/Articles/357188/ dlang <div class="FormattedComment"> yes, and I did that for a while, but then an update to udev added it back in.<br> </div> Thu, 15 Oct 2009 17:46:50 +0000 Char devices for network interfaces https://lwn.net/Articles/357184/ https://lwn.net/Articles/357184/ dlang <div class="FormattedComment"> ethtool -p ethX is your friend, for many cards it will blink a light on the card so you can identify which interface it is.<br> </div> Thu, 15 Oct 2009 17:46:20 +0000 Char devices for network interfaces https://lwn.net/Articles/357139/ https://lwn.net/Articles/357139/ Banis <div class="FormattedComment"> This is a real problem that needs solved. When I switched from RHEL4 to RHEL5 every single one of my boxes with multiple network cards had the order of network interfaces randomized. For me that's about 100 boxes that used to have one port as eth0 with RHEL4 and with RHEL5 it was a different one. It was more than a little annoying. When I put a multi-nic card in a box it's a 30 minute exercise to figure out which new ethX device corresponds to which port on the new card. The order never makes sense and never maps to the numbered ports on the card.<br> </div> Thu, 15 Oct 2009 15:24:10 +0000 Char devices for network interfaces https://lwn.net/Articles/357093/ https://lwn.net/Articles/357093/ nix <div class="FormattedComment"> Er, you can tell udev to keep its hands off your network interfaces by simply removing the network generator rules. There's no need to ditch the whole thing.<br> </div> Thu, 15 Oct 2009 12:47:02 +0000 Char devices for network interfaces https://lwn.net/Articles/357059/ https://lwn.net/Articles/357059/ dlang <div class="FormattedComment"> I am currently removing udev from my server systems entirely (in large part due to this issue)<br> <p> prior to this I had manually removed the entry in the udev config that had it deal with network devices.<br> <p> while I understand the theory (you don't want a device to change names and send traffic out the wrong interface), this feature has always caused me significant amounts of trouble, and I've never once had it save me (I manage several hundred firewalls, so in theory I would be the prime beneficiary of this feature) <br> </div> Thu, 15 Oct 2009 06:28:55 +0000 Char devices for network interfaces https://lwn.net/Articles/357038/ https://lwn.net/Articles/357038/ gdt <p>You can't assume the MAC address remains the same before and after a repair. Sysadmins curse every time a faulty mainboard is replaced and then the operating system fails to come up properly.</p> <p>Read Matt's mail, it's a good summary of the current suckiness of network interface name enumeration. Although even it misses some classics, such as some Intel motherboards being marked NIC1 and NIC2 and getting eth1 and eth0 respectively assigned to those interfaces, despite DMI being correct.</p> Thu, 15 Oct 2009 04:14:41 +0000 Char devices for network interfaces https://lwn.net/Articles/357031/ https://lwn.net/Articles/357031/ BenHutchings <div class="FormattedComment"> Actually, the char devices don't even emit uevents. The idea is that the minor number of the device node identifies the net device by its ifindex (an immutable identifier, unlike its name). The char driver only exists to reserve a major number because I (and possibly others) objected to creating device nodes without reserving their numbers.<br> <p> I have some unfinished code to make the char devices usable as an alternate means of submitting ioctls to net devices. The current method is to call ioctl() on a socket, embedding the device name in the request structure, which can race with device renaming. However, this is probably unnecessary as most or all device control operations can be done through netlink-based APIs which already use ifindex.<br> <p> </div> Thu, 15 Oct 2009 02:54:28 +0000 Char devices for network interfaces https://lwn.net/Articles/357023/ https://lwn.net/Articles/357023/ marineam <div class="FormattedComment"> udev has handled persistent names (even automatically!) based on MAC address for ages... I even had to submit a patch to disable the behavior on Xen because the ethX name was getting incremented by 1 every time the VM rebooted and got a new randomly assigned MAC address. :-P<br> <p> Is everyone using distros that like to disable this feature or something?<br> </div> Thu, 15 Oct 2009 02:03:56 +0000