Defer handling wdev config updates until the entire config has been processed.
Fixes an issue where only the changes of the first modified vif would be accepted
Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!wdev->autostart)
return;
if (!wdev->autostart)
return;
- if (!force && (wdev->state != IFS_DOWN || config_init))
+ if ((!force && wdev->state != IFS_DOWN) || config_init)
return;
free(wdev->prev_config);
return;
free(wdev->prev_config);
if (wdev->config_state != IFC_NORMAL)
return;
if (wdev->config_state != IFC_NORMAL)
return;
+ wdev->config_update = false;
if (s == IFC_RELOAD && wdev->reconf && wdev->state == IFS_UP) {
wireless_device_reconf(wdev);
return;
if (s == IFC_RELOAD && wdev->reconf && wdev->state == IFS_UP) {
wireless_device_reconf(wdev);
return;
free(wdev->config);
wdev->config = blob_memdup(new_config);
wdev->disabled = disabled;
free(wdev->config);
wdev->config = blob_memdup(new_config);
wdev->disabled = disabled;
- wdev_set_config_state(wdev, IFC_RELOAD);
+ wdev->config_update = true;
- wdev_set_config_state(wdev, IFC_RELOAD);
+ wdev->config_update = true;
}
/* parse blob config into the vlan object */
}
/* parse blob config into the vlan object */
- wdev_set_config_state(wdev, IFC_RELOAD);
+ wdev->config_update = true;
}
/* vlist update call for station list */
}
/* vlist update call for station list */
- wdev_set_config_state(wdev, IFC_RELOAD);
+ wdev->config_update = true;
{
struct wireless_device *wdev;
{
struct wireless_device *wdev;
- vlist_for_each_element(&wireless_devices, wdev, node)
+ vlist_for_each_element(&wireless_devices, wdev, node) {
+ if (wdev->config_update)
+ wdev_set_config_state(wdev, IFC_RELOAD);
__wireless_device_set_up(wdev, 0);
__wireless_device_set_up(wdev, 0);
}
void wireless_device_hotplug_event(const char *name, bool add)
}
void wireless_device_hotplug_event(const char *name, bool add)
bool handler_action;
bool handler_pending;
bool serialize;
bool handler_action;
bool handler_pending;
bool serialize;
struct wireless_driver *drv;
struct vlist_tree interfaces;
struct wireless_driver *drv;
struct vlist_tree interfaces;