interface: clean up after hotplug interfaces are removed
authorFelix Fietkau <nbd@openwrt.org>
Mon, 4 Jun 2012 18:19:53 +0000 (20:19 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 4 Jun 2012 18:19:53 +0000 (20:19 +0200)
interface.c

index 3215f49..01dabad 100644 (file)
@@ -215,6 +215,8 @@ interface_cb(struct device_user *dep, enum device_event ev)
        }
 
        interface_set_available(iface, new_state);
        }
 
        interface_set_available(iface, new_state);
+       if (!new_state && dep->dev->external)
+               interface_set_main_dev(iface, NULL);
 }
 
 void
 }
 
 void