]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Use helper variables to clean up code
authorRaphaël Mélotte <raphael.melotte@mind.be>
Thu, 4 Feb 2021 15:36:13 +0000 (16:36 +0100)
committerJouni Malinen <j@w1.fi>
Sat, 6 Feb 2021 15:12:24 +0000 (17:12 +0200)
This is in preparation of larger changes in hostapd_update_wps() to keep
the commits more readable.

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
src/ap/wps_hostapd.c

index dc8aa8f65de731465d323860f523095673eb1811..867e55a0f1972973d160ed54dc71062619ce5f25 100644 (file)
@@ -1398,22 +1398,25 @@ void hostapd_deinit_wps(struct hostapd_data *hapd)
 
 void hostapd_update_wps(struct hostapd_data *hapd)
 {
-       if (hapd->wps == NULL)
+       struct wps_context *wps = hapd->wps;
+       struct hostapd_bss_config *conf = hapd->conf;
+
+       if (!wps)
                return;
 
 #ifdef CONFIG_WPS_UPNP
-       hapd->wps->friendly_name = hapd->conf->friendly_name;
-       hapd->wps->manufacturer_url = hapd->conf->manufacturer_url;
-       hapd->wps->model_description = hapd->conf->model_description;
-       hapd->wps->model_url = hapd->conf->model_url;
-       hapd->wps->upc = hapd->conf->upc;
+       wps->friendly_name = conf->friendly_name;
+       wps->manufacturer_url = conf->manufacturer_url;
+       wps->model_description = conf->model_description;
+       wps->model_url = conf->model_url;
+       wps->upc = conf->upc;
 #endif /* CONFIG_WPS_UPNP */
 
-       hostapd_wps_set_vendor_ext(hapd, hapd->wps);
-       hostapd_wps_set_application_ext(hapd, hapd->wps);
+       hostapd_wps_set_vendor_ext(hapd, wps);
+       hostapd_wps_set_application_ext(hapd, wps);
 
-       if (hapd->conf->wps_state)
-               wps_registrar_update_ie(hapd->wps->registrar);
+       if (conf->wps_state)
+               wps_registrar_update_ie(wps->registrar);
        else
                hostapd_deinit_wps(hapd);
 }