wireless: call wireless_interface_handle_link before updating vif config
authorFelix Fietkau <nbd@openwrt.org>
Wed, 2 Dec 2015 13:49:10 +0000 (14:49 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 2 Dec 2015 13:49:59 +0000 (14:49 +0100)
If the network changes, we need to remove the vif from the old network
before we lose access to the previous state

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
wireless.c

index 1f96089..34dd328 100644 (file)
@@ -591,6 +591,7 @@ vif_update(struct vlist_tree *tree, struct vlist_node *node_new,
                }
 
                D(WIRELESS, "Update wireless interface %s on device %s\n", vif_new->name, wdev->name);
+               wireless_interface_handle_link(vif_old, false);
                free(vif_old->config);
                vif_old->config = blob_memdup(vif_new->config);
                vif_old->isolate = vif_new->isolate;