From 20a1bac4810e98a463380e5d0f1f77c72ac31941 Mon Sep 17 00:00:00 2001 From: Alex Oprea Date: Mon, 8 May 2017 16:30:13 +0200 Subject: [PATCH] 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 --- bridge.c | 6 +++--- 1 file 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; -- 2.25.1