aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-09-05 09:34:04 (GMT)
committerJouni Malinen <j@w1.fi>2010-09-07 15:20:44 (GMT)
commit6300a9c96a0ff6e3f91326b4a3686647aec56a5c (patch)
treebd884240b8ea9935282b28729fb20be2f9dc55d7
parent08fbc372b44bcd273e335edf15f751c5dbb8a508 (diff)
downloadhostap-07-6300a9c96a0ff6e3f91326b4a3686647aec56a5c.zip
hostap-07-6300a9c96a0ff6e3f91326b4a3686647aec56a5c.tar.gz
hostap-07-6300a9c96a0ff6e3f91326b4a3686647aec56a5c.tar.bz2
WPS: Fix hostapd build without CONFIG_WPS_UPNP
Commit 5a1cc30f1a04eb19d315680928927651024e172e added code that was assuming CONFIG_WPS_UPNP is enabled whenever CONFIG_WPS is. Fix this by making the UPnP calls conditional on CONFIG_WPS_UPNP define. (cherry picked from commit 0caf077bc16a1061fb78cede8d0916eb24b3bd8a)
-rw-r--r--src/ap/wps_hostapd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ap/wps_hostapd.c b/src/ap/wps_hostapd.c
index bc747ce..a6ffd4d 100644
--- a/src/ap/wps_hostapd.c
+++ b/src/ap/wps_hostapd.c
@@ -975,7 +975,9 @@ void hostapd_wps_ap_pin_disable(struct hostapd_data *hapd)
wpa_printf(MSG_DEBUG, "WPS: Disabling AP PIN");
os_free(hapd->conf->ap_pin);
hapd->conf->ap_pin = NULL;
+#ifdef CONFIG_WPS_UPNP
upnp_wps_set_ap_pin(hapd->wps_upnp, NULL);
+#endif /* CONFIG_WPS_UPNP */
eloop_cancel_timeout(hostapd_wps_ap_pin_timeout, hapd, NULL);
}
@@ -989,7 +991,9 @@ const char * hostapd_wps_ap_pin_random(struct hostapd_data *hapd, int timeout)
os_snprintf(pin_txt, sizeof(pin_txt), "%u", pin);
os_free(hapd->conf->ap_pin);
hapd->conf->ap_pin = os_strdup(pin_txt);
+#ifdef CONFIG_WPS_UPNP
upnp_wps_set_ap_pin(hapd->wps_upnp, pin_txt);
+#endif /* CONFIG_WPS_UPNP */
hostapd_wps_ap_pin_enable(hapd, timeout);
return hapd->conf->ap_pin;
}
@@ -1008,7 +1012,9 @@ int hostapd_wps_ap_pin_set(struct hostapd_data *hapd, const char *pin,
hapd->conf->ap_pin = os_strdup(pin);
if (hapd->conf->ap_pin == NULL)
return -1;
+#ifdef CONFIG_WPS_UPNP
upnp_wps_set_ap_pin(hapd->wps_upnp, hapd->conf->ap_pin);
+#endif /* CONFIG_WPS_UPNP */
hostapd_wps_ap_pin_enable(hapd, timeout);
return 0;
}