WPS ER: Add more debug info on initialization errors
[libeap.git] / src / wps / wps_er.c
index 4726e52..f573d62 100644 (file)
@@ -1195,6 +1195,7 @@ wps_er_init(struct wps_context *wps, const char *ifname, const char *filter)
        }
 
        if (wps_er_ssdp_init(er) < 0) {
+               wpa_printf(MSG_INFO, "WPS UPnP: SSDP initialization failed");
                wps_er_deinit(er, NULL, NULL);
                return NULL;
        }
@@ -1202,6 +1203,7 @@ wps_er_init(struct wps_context *wps, const char *ifname, const char *filter)
        addr.s_addr = er->ip_addr;
        er->http_srv = http_server_init(&addr, -1, wps_er_http_req, er);
        if (er->http_srv == NULL) {
+               wpa_printf(MSG_INFO, "WPS UPnP: HTTP initialization failed");
                wps_er_deinit(er, NULL, NULL);
                return NULL;
        }
@@ -1301,6 +1303,12 @@ static void wps_er_send_set_sel_reg(struct wps_er_ap *ap, struct wpabuf *msg)
                return;
        }
 
+       if (ap->wps) {
+               wpa_printf(MSG_DEBUG, "WPS ER: Pending WPS operation for AP - "
+                          "skip SetSelectedRegistrar");
+               return;
+       }
+
        url = http_client_url_parse(ap->control_url, &dst, &path);
        if (url == NULL) {
                wpa_printf(MSG_DEBUG, "WPS ER: Failed to parse controlURL");