mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 17:42:41 +00:00
27 lines
629 B
Diff
27 lines
629 B
Diff
--- a/src/ap/afc.c
|
|
+++ b/src/ap/afc.c
|
|
@@ -875,13 +875,17 @@ int hostapd_afc_handle_request(struct ho
|
|
if (!hostapd_afc_has_usable_chans(iface))
|
|
goto resched;
|
|
|
|
- /* Trigger an ACS freq scan */
|
|
- iconf->channel = 0;
|
|
- iface->freq = 0;
|
|
+ if (!hostapd_is_usable_chans(iface)) {
|
|
+ /* Trigger an ACS freq scan */
|
|
+ iconf->channel = 0;
|
|
+ iface->freq = 0;
|
|
|
|
- if (acs_init(iface) != HOSTAPD_CHAN_ACS) {
|
|
- wpa_printf(MSG_ERROR, "Could not start ACS");
|
|
- ret = -EINVAL;
|
|
+ if (acs_init(iface) != HOSTAPD_CHAN_ACS) {
|
|
+ wpa_printf(MSG_ERROR, "Could not start ACS");
|
|
+ ret = -EINVAL;
|
|
+ }
|
|
+ } else {
|
|
+ ret = 1;
|
|
}
|
|
|
|
resched:
|