bridge: fix corner case with network reload
authorLuka Perkov <luka@openwrt.org>
Thu, 29 Aug 2013 13:28:27 +0000 (15:28 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 29 Aug 2013 15:17:15 +0000 (17:17 +0200)
After removing all ifname options from bridge interface and executing network
reload the configuration was not applied properly on the system. With this
change that is no longer a issue.

Signed-off-by: Luka Perkov <luka@openwrt.org>
bridge.c

index 05f2ad69133b8f73d38ef355e165fb6aadfe712c..01c9a2c2c0bb1cd49d9c40dc0af4d7c00b433bcb 100644 (file)
--- a/bridge.c
+++ b/bridge.c
@@ -454,12 +454,11 @@ bridge_config_init(struct device *dev)
                device_set_present(&bst->dev, true);
        }
 
-       if (!bst->ifnames)
-               return;
-
        vlist_update(&bst->members);
-       blobmsg_for_each_attr(cur, bst->ifnames, rem) {
-               bridge_add_member(bst, blobmsg_data(cur));
+       if (bst->ifnames) {
+               blobmsg_for_each_attr(cur, bst->ifnames, rem) {
+                       bridge_add_member(bst, blobmsg_data(cur));
+               }
        }
        vlist_flush(&bst->members);
 }