summaryrefslogtreecommitdiff
path: root/bridge.c
diff options
context:
space:
mode:
authorAlex Oprea <alex.oprea@inteno.se>2017-05-08 16:30:13 +0200
committerFelix Fietkau <nbd@nbd.name>2017-05-09 12:51:03 +0200
commit20a1bac4810e98a463380e5d0f1f77c72ac31941 (patch)
tree527207ed0d05e55af689d328cd41b118e538dc34 /bridge.c
parent6b9c2673173f9636647e021a84d560c0863b1b99 (diff)
downloadnetifd-20a1bac4810e98a463380e5d0f1f77c72ac31941.tar.gz
bridge: reset primary only after marking the member not present
Run the bridge_reset_primary function only after the member being removed has been marked as not present. This change prevents the bridge_reset_primary function from choosing the member being removed as the new primary member. Signed-off-by: Alex Oprea <alex.oprea@inteno.se>
Diffstat (limited to 'bridge.c')
-rw-r--r--bridge.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bridge.c b/bridge.c
index c46d44e..96e0209 100644
--- a/bridge.c
+++ b/bridge.c
@@ -240,15 +240,15 @@ bridge_remove_member(struct bridge_member *bm)
if (!bm->present)
return;
- if (bm == bst->primary_port)
- bridge_reset_primary(bst);
-
if (bst->dev.active)
bridge_disable_member(bm);
bm->present = false;
bm->bst->n_present--;
+ if (bm == bst->primary_port)
+ bridge_reset_primary(bst);
+
if (bst->config.bridge_empty)
return;