summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2026-02-26 10:25:53 +0000
committerFelix Fietkau2026-02-26 10:25:53 +0000
commit69a5afc9713adf31edbf3228a7a372ada7bba449 (patch)
tree7b99dadba329cc0d35babc8b333d5fb15e5ab522
parent299a51f0c3011ca98a3f06cd29d50c2e1f86e348 (diff)
downloadnetifd-master.tar.gz
bridge: skip present toggle in bridge_free_member() when device is activeHEADmaster
When moving a device between bridges during config reload, the present toggle in bridge_free_member() can disrupt a bridge that has already successfully claimed the device. During device_init_pending(), bridges are processed in alphabetical order. If the new bridge (e.g. br-lan) is processed before the old bridge (e.g. br-wan), it successfully claims the device. When the old bridge then flushes the device, the present toggle tears down and rebuilds the new bridge unnecessarily, causing interface setup failures. Only toggle the present state when the device has no active claims, which is the case when bridge_enable_member() failed (e.g. because the device was still in the old bridge at the time). Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--bridge.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bridge.c b/bridge.c
index 0c5c430..625680d 100644
--- a/bridge.c
+++ b/bridge.c
@@ -721,7 +721,7 @@ restart:
* Ensure that claiming the device is retried by toggling its present
* state
*/
- if (dev->present) {
+ if (dev->present && !dev->active) {
device_set_present(dev, false);
device_set_present(dev, true);
}