summaryrefslogtreecommitdiffhomepage
path: root/bridge.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-06-27 01:32:07 +0200
committerFelix Fietkau <nbd@openwrt.org>2012-06-27 01:32:07 +0200
commit13f7f295f33c2639c390d4a6b2c58d1845e12fc3 (patch)
treeac2652ef8a71760f4b1714674b1f792a099077e2 /bridge.c
parent515a80251f14d4c033fd49918e9ecac308e135dd (diff)
bridge: fix getting the mac address from the first member device
Diffstat (limited to 'bridge.c')
-rw-r--r--bridge.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/bridge.c b/bridge.c
index 361b409..d29c3c0 100644
--- a/bridge.c
+++ b/bridge.c
@@ -109,11 +109,17 @@ bridge_reset_primary(struct bridge_state *bst)
bst->primary_port = NULL;
bst->dev.settings.flags &= ~DEV_OPT_MACADDR;
vlist_for_each_element(&bst->members, bm, node) {
+ uint8_t *macaddr;
+
if (!bm->present)
continue;
bst->primary_port = bm;
- memcpy(bst->dev.settings.macaddr, bm->dev.dev->settings.macaddr, 6);
+ if (bm->dev.dev->settings.flags & DEV_OPT_MACADDR)
+ macaddr = bm->dev.dev->settings.macaddr;
+ else
+ macaddr = bm->dev.dev->orig_settings.macaddr;
+ memcpy(bst->dev.settings.macaddr, macaddr, 6);
bst->dev.settings.flags |= DEV_OPT_MACADDR;
return;
}