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 1f96089f73a2b6e398da15fe96df361cfb604ab6..34dd328e14de15242ec9241e46b72b2dac9fe57e 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;