bridge: keep existing mac address if specified in the config
authorFelix Fietkau <nbd@openwrt.org>
Thu, 24 May 2012 18:42:12 +0000 (20:42 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 24 May 2012 18:42:12 +0000 (20:42 +0200)
bridge.c

index 1725162a5c62f9d3689898a4105e78aeaaf2aae8..361b409b8de9167fb340fa625d94c5d981446603 100644 (file)
--- a/bridge.c
+++ b/bridge.c
@@ -102,7 +102,12 @@ bridge_reset_primary(struct bridge_state *bst)
 {
        struct bridge_member *bm;
 
+       if (!bst->primary_port &&
+           (bst->dev.settings.flags & DEV_OPT_MACADDR))
+               return;
+
        bst->primary_port = NULL;
+       bst->dev.settings.flags &= ~DEV_OPT_MACADDR;
        vlist_for_each_element(&bst->members, bm, node) {
                if (!bm->present)
                        continue;