From: Jouni Malinen Date: Thu, 28 Nov 2013 10:48:28 +0000 (+0200) Subject: WPS NFC: Use AP Channel information from credential container X-Git-Tag: hostap_2_1~49 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5cd4f66095fa39b198315947c56e97e9be615160;p=thirdparty%2Fhostap.git WPS NFC: Use AP Channel information from credential container This allows NFC Configuration Token to indicate the current AP operating channel, so that a single channel scan can be used to speed up the initial connection. Signed-hostap: Jouni Malinen --- diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c index 1f6dd92ad..33a1d31b0 100644 --- a/wpa_supplicant/wps_supplicant.c +++ b/wpa_supplicant/wps_supplicant.c @@ -2210,6 +2210,12 @@ static int wpas_wps_use_cred(struct wpa_supplicant *wpa_s, if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) return 0; + if (!wpa_s->wps_ap_channel && attr->ap_channel) { + wpa_s->wps_ap_channel = WPA_GET_BE16(attr->ap_channel); + wpa_printf(MSG_DEBUG, "WPS: Credential container indicated AP Channel %d", + wpa_s->wps_ap_channel); + } + wpa_printf(MSG_DEBUG, "WPS: Request reconnection with new network " "based on the received credential added"); wpa_s->normal_scans = 0;