Comment 3 for bug 78043

Revision history for this message
Roshan Shariff (roshan.shariff) wrote :

This change breaks hotplug for all network devices, because none of the wired, PPP, Bluetooth, etc. devices on my system have a DRIVER sysfs attribute. For example:

  looking at device '/class/net/eth0':
    KERNEL=="eth0"
    SUBSYSTEM=="net"
    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:06:01.0':
    KERNELS=="0000:06:01.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="8139too"

  looking at parent device '/devices/pci0000:00/0000:00:1e.0':
    KERNELS=="0000:00:1e.0"
    SUBSYSTEMS=="pci"
    DRIVERS==""

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

It is only the parent device that has a driver.

The "DRIVER" line was later changed to "DRIVERS" in ifupdown_0.6.8ubuntu5, which is still problematic. It only runs the ifup/ifdown rules if /all/ devices in the chain have a driver, rather than running them if /any/ device has a driver. In other words, DRIVERS!="?*" works like (DRIVER!="?* [OR] parent.DRIVER!="?*" [OR] ...) instead of (NOT (DRIVER=="?*" [OR] parent.DRIVER=="?*" ...))

The simplest way I can think of to solve this is to remove the negation and add a DRIVERS="?*" clause to the individual add and remove rules. A patch implementing this solution is attached. It works correctly for the PPP case, since ppp devices have no DEVICE set nor any parent devices. It also works correctly for other hotpluggable devices (like bnep*), because they eventually have a USB device as a parent.

I suppose this problem went unnoticed thus far because of the rarity of hotpluggable network devices. I only noticed it now when my bluetooth PAN interface refused to come up automatically on connecting.