From: Raphaël Mélotte Date: Thu, 4 Feb 2021 15:36:13 +0000 (+0100) Subject: WPS: Use helper variables to clean up code X-Git-Tag: hostap_2_10~630 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fd90eb095e18ce1c505bb6acaccff76072aeebe;p=thirdparty%2Fhostap.git WPS: Use helper variables to clean up code This is in preparation of larger changes in hostapd_update_wps() to keep the commits more readable. Signed-off-by: Raphaël Mélotte --- diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c index dc8aa8f65..867e55a0f 100644 --- a/src/ap/wps_hostapd.c +++ b/src/ap/wps_hostapd.c @@ -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); }