netifd: fix bridge reloading issue
authorEmanuel Taube <emanuel.taube@gmail.com>
Fri, 7 Mar 2014 09:22:12 +0000 (10:22 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 7 Mar 2014 18:05:50 +0000 (19:05 +0100)
Check in the right order to decide if the bridge have to be set up.
Additionally we are consistent with setting it down.

Signed-off-by: Emanuel Taube <emanuel.taube@gmail.com>
bridge.c

index 4ef0d7e20940587e324291c6a1df45ef926d2298..7bd1cf0c17bb341bf3a60e97336e3f8a768719de 100644 (file)
--- a/bridge.c
+++ b/bridge.c
@@ -231,10 +231,10 @@ bridge_member_cb(struct device_user *dev, enum device_event ev)
                bm->present = true;
                bst->n_present++;
 
+               if (bst->n_present == 1)
+                       device_set_present(&bst->dev, true);
                if (bst->dev.active)
                        bridge_enable_member(bm);
-               else if (bst->n_present == 1)
-                       device_set_present(&bst->dev, true);
 
                break;
        case DEV_EVENT_REMOVE: