From 440eb0647708274cc8d7d9e7c2bb0cfdfba90023 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 26 Jul 2021 20:39:17 +0200 Subject: [PATCH] bridge: fix regression in bringing up bridge ports Move the DEV_EVENT_LINK_UP case to avoid messing with a fallthrough Only restart members if the vlan check returns a positive result Fixes: 85f01c44a950 ("bridge: check bridge port vlan membership on link-up events") Signed-off-by: Felix Fietkau --- bridge.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bridge.c b/bridge.c index 32796bf..7acfb81 100644 --- a/bridge.c +++ b/bridge.c @@ -510,7 +510,7 @@ bridge_member_check_cb(struct uloop_timeout *t) bm = container_of(t, struct bridge_member, check_timer); bst = bm->bst; - if (!system_bridge_vlan_check(&bst->dev, bm->dev.dev->ifname)) + if (system_bridge_vlan_check(&bst->dev, bm->dev.dev->ifname) <= 0) return; bridge_disable_member(bm, true); @@ -534,9 +534,6 @@ bridge_member_cb(struct device_user *dep, enum device_event ev) if (bst->n_present == 1) device_set_present(&bst->dev, true); fallthrough; - case DEV_EVENT_LINK_UP: - uloop_timeout_set(&bm->check_timer, 1000); - break; case DEV_EVENT_AUTH_UP: if (!bst->dev.active) break; @@ -552,6 +549,10 @@ bridge_member_cb(struct device_user *dep, enum device_event ev) system_if_apply_settings(&bst->dev, &bst->dev.settings, DEV_OPT_MTU | DEV_OPT_MTU6); break; + case DEV_EVENT_LINK_UP: + if (bst->has_vlans) + uloop_timeout_set(&bm->check_timer, 1000); + break; case DEV_EVENT_LINK_DOWN: if (!dev->settings.auth) break; -- 2.30.2