netifd: fix hotplug-adding of non-bridge interfaces by setting the l3 device early
authorFelix Fietkau <nbd@openwrt.org>
Wed, 28 Mar 2012 17:28:24 +0000 (20:28 +0300)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 28 Mar 2012 17:28:24 +0000 (20:28 +0300)
interface.c

index c5addeab346be1b6caee3e42eb49aead648b9186..d7498968de6be4fcb4bbd08353f0df43ca640bcc 100644 (file)
@@ -420,10 +420,10 @@ interface_set_main_dev(struct interface *iface, struct device *dev)
        if (iface->main_dev.dev == dev)
                return;
 
-       device_add_user(&iface->main_dev, dev);
        if (set_l3)
                interface_set_l3_dev(iface, dev);
 
+       device_add_user(&iface->main_dev, dev);
        if (claimed)
                device_claim(&iface->l3_dev);