[RFC 14/34] wpa_supplicant: Check SYNC_CONFIG support

Andrei Otcheretianski andrei.otcheretianski at intel.com
Wed Aug 13 10:38:58 PDT 2025


Currently, NAN support is assumed if NAN device interface is supported.
Since wpa_supplicant implementation is intended to work with new driver
and kernel only, make sure WPA_DRIVER_FLAGS_NAN_SUPPORT_SYNC_CONFIG flag
is set.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 wpa_supplicant/nan_supplicant.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/wpa_supplicant/nan_supplicant.c b/wpa_supplicant/nan_supplicant.c
index e8d3650c6b..d29deaa99f 100644
--- a/wpa_supplicant/nan_supplicant.c
+++ b/wpa_supplicant/nan_supplicant.c
@@ -38,7 +38,8 @@ int wpas_nan_init(struct wpa_supplicant *wpa_s)
 {
 	struct nan_config nan;
 
-	if (!(wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_SUPPORT_NAN)) {
+	if (!(wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_SUPPORT_NAN) ||
+	    !(wpa_s->nan_drv_flags & WPA_DRIVER_FLAGS_NAN_SUPPORT_SYNC_CONFIG)) {
 		wpa_printf(MSG_DEBUG, "NAN: NAN is not supported");
 		return -1;
 	}
@@ -84,6 +85,13 @@ int wpas_nan_start(struct wpa_supplicant *wpa_s)
 	if (!wpas_nan_ready(wpa_s))
 		return -1;
 
+	if (!(wpa_s->nan_drv_flags &
+	      WPA_DRIVER_FLAGS_NAN_SUPPORT_SYNC_CONFIG)) {
+		wpa_printf(MSG_DEBUG,
+			   "NAN: Driver doesn't support configurable NAN sync");
+		return -1;
+	}
+
 	cluster_config.master_pref = DEFAULT_NAN_MASTER_PREF;
 	cluster_config.dual_band = DEFAULT_NAN_DUAL_BAND;
 
-- 
2.49.0




More information about the Hostap mailing list