WPS: Fix hostapd build without CONFIG_WPS_UPNP
authorJouni Malinen <j@w1.fi>
Sun, 5 Sep 2010 09:34:04 +0000 (12:34 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 5 Sep 2010 09:34:04 +0000 (12:34 +0300)
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.

src/ap/wps_hostapd.c

index bc747ce..a6ffd4d 100644 (file)
@@ -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;
 }