bridge: bring up pre-existing vlans on hotplug as well
authorFelix Fietkau <nbd@nbd.name>
Wed, 23 Jun 2021 08:01:41 +0000 (10:01 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 23 Jun 2021 08:01:42 +0000 (10:01 +0200)
When adding a member to an existing VLAN, it needs to be updated as well

Signed-off-by: Felix Fietkau <nbd@nbd.name>
bridge.c

index 925cfe4911843c70a1f3c241da07cd29ba1daa5f..4f3fe35eef7fcb69dc446cfbcd3d47724f331ad5 100644 (file)
--- a/bridge.c
+++ b/bridge.c
@@ -704,11 +704,6 @@ bridge_hotplug_get_vlan(struct bridge_state *bst, unsigned int vid)
        INIT_LIST_HEAD(&vlan->hotplug_ports);
        vlist_add(&bst->dev.vlans, &vlan->node, &vlan->vid);
        vlan->node.version = -1;
-       if (!vlan->pending)
-               return vlan;
-
-       vlan->pending = false;
-       bridge_set_vlan_state(bst, vlan, true);
 
        return vlan;
 }
@@ -754,6 +749,11 @@ bridge_hotplug_set_member_vlans(struct bridge_state *bst, struct blob_attr *vlan
                if (!vlan)
                        continue;
 
+               if (vlan->pending) {
+                       vlan->pending = false;
+                       bridge_set_vlan_state(bst, vlan, true);
+               }
+
                if (end && *end) {
                        if (*end != ':')
                                continue;