summaryrefslogtreecommitdiffhomepage
path: root/bridge.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-05-24 20:42:12 +0200
committerFelix Fietkau <nbd@openwrt.org>2012-05-24 20:42:12 +0200
commit2dfdcd4c6a2381bedb6e1b10ff0fdc4246802c82 (patch)
tree385b1e8b7d938559b213cc7158ab6910067f2796 /bridge.c
parentbb05211c9c2abbda5866c44ad86994fabf9247e0 (diff)
bridge: keep existing mac address if specified in the config
Diffstat (limited to 'bridge.c')
-rw-r--r--bridge.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/bridge.c b/bridge.c
index 1725162..361b409 100644
--- 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;