hostapd: fix bringing up AP in AP+mesh configurations
authorFelix Fietkau <nbd@nbd.name>
Tue, 12 Sep 2023 12:09:26 +0000 (14:09 +0200)
committerFelix Fietkau <nbd@nbd.name>
Tue, 12 Sep 2023 12:09:59 +0000 (14:09 +0200)
Pass the correct frequency + secondary channel offset to hostapd

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/services/hostapd/src/wpa_supplicant/ucode.c

index d120ed6217d6e9ad71db8c31caa413e0bf1f0b0b..55d22584ff4d4d8a9309edfe3b87a54ed7f17e73 100644 (file)
@@ -2,6 +2,7 @@
 #include "utils/common.h"
 #include "utils/ucode.h"
 #include "drivers/driver.h"
+#include "ap/hostapd.h"
 #include "wpa_supplicant_i.h"
 #include "wps_supplicant.h"
 #include "bss.h"
@@ -225,6 +226,15 @@ uc_wpas_iface_status(uc_vm_t *vm, size_t nargs)
                ucv_object_add(ret, "frequency", ucv_int64_new(bss->freq));
        }
 
+#ifdef CONFIG_MESH
+       if (wpa_s->ifmsh) {
+               struct hostapd_iface *ifmsh = wpa_s->ifmsh;
+
+               ucv_object_add(ret, "sec_chan_offset", ucv_int64_new(ifmsh->conf->secondary_channel));
+               ucv_object_add(ret, "frequency", ucv_int64_new(ifmsh->freq));
+       }
+#endif
+
        return ret;
 }