diff options
author | Vinay Adella <vinay.adella@atheros.com> | 2011-05-19 12:55:47 +0300 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2011-05-19 12:55:47 +0300 |
commit | 86795546f7bf06a306ee288a7c8e7aad6d6a58f3 (patch) | |
tree | 13fe6d40d98d56af3b0df801395aa89f841e5f51 /src/ap/wps_hostapd.c | |
parent | fa5165586fa11ecdccb7c81d40979b51c2583fd2 (diff) | |
download | external_wpa_supplicant_8_ti-86795546f7bf06a306ee288a7c8e7aad6d6a58f3.zip external_wpa_supplicant_8_ti-86795546f7bf06a306ee288a7c8e7aad6d6a58f3.tar.gz external_wpa_supplicant_8_ti-86795546f7bf06a306ee288a7c8e7aad6d6a58f3.tar.bz2 |
WPS UPnP: Fix UPnP initialization for non-bridge case with some drivers
If the driver wrapper is setting up the interface up only at commit(),
UPnP initialization fails. Fix that by moving UPnP setup to happen after
the driver commit() call.
Diffstat (limited to 'src/ap/wps_hostapd.c')
-rw-r--r-- | src/ap/wps_hostapd.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c index fcbd89b..fc927f9 100644 --- a/src/ap/wps_hostapd.c +++ b/src/ap/wps_hostapd.c @@ -876,20 +876,34 @@ int hostapd_init_wps(struct hostapd_data *hapd, wps->model_description = hapd->conf->model_description; wps->model_url = hapd->conf->model_url; wps->upc = hapd->conf->upc; +#endif /* CONFIG_WPS_UPNP */ + + hostapd_register_probereq_cb(hapd, hostapd_wps_probe_req_rx, hapd); + + hapd->wps = wps; + + return 0; +} + + +int hostapd_init_wps_complete(struct hostapd_data *hapd) +{ + struct wps_context *wps = hapd->wps; + + if (hapd->wps == NULL) + return 0; +#ifdef CONFIG_WPS_UPNP if (hostapd_wps_upnp_init(hapd, wps) < 0) { wpa_printf(MSG_ERROR, "Failed to initialize WPS UPnP"); wps_registrar_deinit(wps->registrar); os_free(wps->network_key); os_free(wps); + hapd->wps = NULL; return -1; } #endif /* CONFIG_WPS_UPNP */ - hostapd_register_probereq_cb(hapd, hostapd_wps_probe_req_rx, hapd); - - hapd->wps = wps; - return 0; } |