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 <raphael.melotte@mind.be>
This commit is contained in:
Raphaël Mélotte 2021-02-04 16:36:13 +01:00 committed by Jouni Malinen
parent f7bbad5768
commit 2fd90eb095

View file

@ -1398,22 +1398,25 @@ void hostapd_deinit_wps(struct hostapd_data *hapd)
void hostapd_update_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; return;
#ifdef CONFIG_WPS_UPNP #ifdef CONFIG_WPS_UPNP
hapd->wps->friendly_name = hapd->conf->friendly_name; wps->friendly_name = conf->friendly_name;
hapd->wps->manufacturer_url = hapd->conf->manufacturer_url; wps->manufacturer_url = conf->manufacturer_url;
hapd->wps->model_description = hapd->conf->model_description; wps->model_description = conf->model_description;
hapd->wps->model_url = hapd->conf->model_url; wps->model_url = conf->model_url;
hapd->wps->upc = hapd->conf->upc; wps->upc = conf->upc;
#endif /* CONFIG_WPS_UPNP */ #endif /* CONFIG_WPS_UPNP */
hostapd_wps_set_vendor_ext(hapd, hapd->wps); hostapd_wps_set_vendor_ext(hapd, wps);
hostapd_wps_set_application_ext(hapd, hapd->wps); hostapd_wps_set_application_ext(hapd, wps);
if (hapd->conf->wps_state) if (conf->wps_state)
wps_registrar_update_ie(hapd->wps->registrar); wps_registrar_update_ie(wps->registrar);
else else
hostapd_deinit_wps(hapd); hostapd_deinit_wps(hapd);
} }