Bug Description

Binary package hint: ifupdown

Package: ifupdown
Version: 0.6.8ubuntu6
Severity: normal
Tags: patch

In the /etc/udev/rules.d/85-ifupdown.rules, the remove
rule is, like the add one, conditionalised under
SUBSYSTEM=="net" and DRIVERS=="?*". Unfortunately,
on my system (cdc usb ether driver, connecting to openmoko phone)
the DRIVERS variable isn't set at all when the device is unplugged.

This causes ifdown to fail to be run on device removal, which prevents
the device working next time it is plugged in, since ifup doesn't
do anything when the interface is already up.

Fix: Move the remove line to the end of the file, and insert conditional
subsystem.

Related branches

I can confirm this on my hardware, a Netgear WG111v2, using the rtl8187 driver.

My workaround was just to remove "DRIVERS=?*", since I didn't see how a network device could appear without a driver anyway. I'd say the real bug is either in udev or the kernel not providing this information.

An obvious reason to be interested in the driver would be to remove the kernel module when the last device supported by it is removed.

Neither of the fixes works properly on Ibex. Both cause routing and /etc/resolv.conf to get trashed with incorrect values from usb0 which has neither a default gateway nor DNS servers defined. The end result is two default routes in the routing table with the usb0 route having higher priority than the eth0 route, a blank /etc/resolv.conf, and no internet connectivity.

Note that without the above fixes this situation does not occur, but as before, the device can only be plugged in once time.

* debian/ifupdown.udev: Unconditionally call ifdown when the network
interface is removed, instead of checking DRIVERS which is likely gone
anyway. LP: #130437.
* Clean up the mess of the rules file while I was in there ;)

It looks broken again since I've upgraded to Karmic.
ifupdown 0.6.8ubuntu20 changelog says: Replace the udev rule with a per-interface Upstart job.
Works again if I put the old udev rule file in /etc/udev/rules.d

yeah I just found out Karmic has a typo in /etc/init/network-interface.conf

stop on net-device-removed INTERFACE=$INTERFACE

should be

stop on net-device-remove INTERFACE=$INTERFACE

Furthermore, the DRIVERS var is not filled when the device gets plugged (add action), resulting in an infinite amount of entries in /etc/udev/rules.d/70-persistent-net.rules (because the device doesn't match the dynamically generated rule there)

yeah I just found out Karmic has a typo in /etc/init/network-interface.conf

stop on net-device-removed INTERFACE=$INTERFACE

should be

stop on net-device-remove INTERFACE=$INTERFACE

Furthermore, the DRIVERS var is not filled when the device gets plugged (add action), resulting in an infinite amount of entries in /etc/udev/rules.d/70-persistent-net.rules (because the device doesn't match the dynamically generated rule there)