From: Jouni Malinen Date: Thu, 23 Sep 2010 02:34:32 +0000 (-0700) Subject: WPS: Fix hostapd reconfig to update WPS UPnP string pointers X-Git-Tag: hostap-1-bp~1027 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa37511fa7e9d6a8f4fdaa8ec2df4af71bac7941;p=thirdparty%2Fhostap.git WPS: Fix hostapd reconfig to update WPS UPnP string pointers This is needed to update the pointers maintained within WPS code to use the new configuration data instead of maintaining pointers to the old configuration which will be freed. This fixes strings in UPnP discovery after reconfig (they used to be random freed memory..). --- diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c index 269423145..7963d6080 100644 --- a/src/ap/wps_hostapd.c +++ b/src/ap/wps_hostapd.c @@ -784,6 +784,15 @@ void hostapd_update_wps(struct hostapd_data *hapd) { if (hapd->wps == NULL) 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; +#endif /* CONFIG_WPS_UPNP */ + if (hapd->conf->wps_state) wps_registrar_update_ie(hapd->wps->registrar); else