Skip to content

Commit 3786d15

Browse files
committed
hostapd: fix bss config reload while in DFS state
Only start a BSS after a config change if it was started before. Signed-off-by: Felix Fietkau <nbd@nbd.name>
1 parent 217c315 commit 3786d15

File tree

1 file changed

+6
-1
lines changed
  • package/network/services/hostapd/src/src/ap

1 file changed

+6
-1
lines changed

package/network/services/hostapd/src/src/ap/ucode.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ uc_hostapd_bss_set_config(uc_vm_t *vm, size_t nargs)
256256
uc_value_t *files_only = uc_fn_arg(2);
257257
unsigned int i, idx = 0;
258258
int ret = -1;
259+
bool started;
259260

260261
if (!hapd || ucv_type(file) != UC_STRING)
261262
goto out;
@@ -287,6 +288,7 @@ uc_hostapd_bss_set_config(uc_vm_t *vm, size_t nargs)
287288
goto free;
288289
}
289290

291+
started = hapd->started;
290292
__uc_hostapd_bss_stop(hapd);
291293

292294
old_bss = hapd->conf;
@@ -299,7 +301,10 @@ uc_hostapd_bss_set_config(uc_vm_t *vm, size_t nargs)
299301
if (hapd == iface->bss[0])
300302
memcpy(hapd->own_addr, hapd->conf->bssid, ETH_ALEN);
301303

302-
ret = __uc_hostapd_bss_start(hapd);
304+
if (started)
305+
ret = __uc_hostapd_bss_start(hapd);
306+
else
307+
ret = 0;
303308
hostapd_ucode_update_interfaces();
304309

305310
free:

0 commit comments

Comments
 (0)