From: Felix Fietkau Date: Tue, 19 Sep 2023 09:44:34 +0000 (+0200) Subject: wireless: update prev_config on SET_DATA notify X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=7a58b995fdbecd9beed57e4d66d42cb3cf66aee2;p=project%2Fnetifd.git wireless: update prev_config on SET_DATA notify Fixes passing phy name from setup to teardown Signed-off-by: Felix Fietkau --- diff --git a/wireless.c b/wireless.c index a21bf54..7ad2fcf 100644 --- a/wireless.c +++ b/wireless.c @@ -692,6 +692,14 @@ wdev_set_config_state(struct wireless_device *wdev, enum interface_config_state __wireless_device_set_down(wdev); } +static void +wdev_prepare_prev_config(struct wireless_device *wdev) +{ + prepare_config(wdev, &b, false); + free(wdev->prev_config); + wdev->prev_config = blob_memdup(b.head); +} + static void wdev_change_config(struct wireless_device *wdev, struct wireless_device *wd_new) { @@ -1511,6 +1519,7 @@ wireless_device_notify(struct wireless_device *wdev, struct blob_attr *data, wireless_vlan_set_data(vlan); else if (vif) wireless_interface_set_data(vif); + wdev_prepare_prev_config(wdev); break; case NOTIFY_CMD_PROCESS_ADD: return wireless_device_add_process(wdev, cur);