interface: clear iface->available before changing main_dev
authorFelix Fietkau <nbd@openwrt.org>
Fri, 2 May 2014 17:04:42 +0000 (19:04 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 2 May 2014 17:07:28 +0000 (19:07 +0200)
Fixes bogus interface restart loop on interface_remove_link

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
interface.c

index 65bc37d07154d64fbf010c7150d213fd0e65845f..95e1ee8f3d7316b3325f866878dd0183d8af47c1 100644 (file)
@@ -780,6 +780,7 @@ interface_set_main_dev(struct interface *iface, struct device *dev)
        if (iface->main_dev.dev == dev)
                return;
 
+       interface_set_available(iface, false);
        device_add_user(&iface->main_dev, dev);
        if (!dev) {
                interface_set_link_state(iface, false);