bridge: preserve hotplug ports on vlan update if config is unchanged
authorFelix Fietkau <nbd@nbd.name>
Wed, 4 Nov 2020 11:19:20 +0000 (12:19 +0100)
committerFelix Fietkau <nbd@nbd.name>
Thu, 5 Nov 2020 11:03:49 +0000 (12:03 +0100)
Fixes cleanup of port state

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

index cf874083de8083afc2a765ef39551da7bb73a93d..91036d26a09cb8aa6c3c08ec918512aba51142ec 100644 (file)
--- a/bridge.c
+++ b/bridge.c
@@ -1060,8 +1060,10 @@ bridge_vlan_update(struct vlist_tree *tree, struct vlist_node *node_new,
        if (node_new)
                vlan_new = container_of(node_new, struct bridge_vlan, node);
 
-       if (node_new && node_old && bridge_vlan_equal(vlan_old, vlan_new))
+       if (node_new && node_old && bridge_vlan_equal(vlan_old, vlan_new)) {
+               list_splice_init(&vlan_old->hotplug_ports, &vlan_new->hotplug_ports);
                goto out;
+       }
 
        if (node_old)
                bridge_set_vlan_state(bst, vlan_old, false);