]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS ER: Do not use SetSelectedRegistrar when learning/configuring AP
authorJouni Malinen <jouni.malinen@atheros.com>
Wed, 21 Jul 2010 05:06:28 +0000 (22:06 -0700)
committerJouni Malinen <j@w1.fi>
Thu, 9 Sep 2010 13:07:49 +0000 (06:07 -0700)
src/wps/wps_er.c
src/wps/wps_er.h

index 51306cb0f149dd8ba726524f7685a6f21ce6d287..c1ed6b4d3cce1f033104d9ff7aed2fdda8d73af6 100644 (file)
@@ -1366,6 +1366,11 @@ void wps_er_set_sel_reg(struct wps_er *er, int sel_reg, u16 dev_passwd_id,
        struct wpabuf *msg;
        struct wps_er_ap *ap;
 
+       if (er->skip_set_sel_reg) {
+               wpa_printf(MSG_DEBUG, "WPS ER: Skip SetSelectedRegistrar");
+               return;
+       }
+
        msg = wpabuf_alloc(500);
        if (msg == NULL)
                return;
@@ -1702,8 +1707,9 @@ int wps_er_learn(struct wps_er *er, const u8 *uuid, const u8 *pin,
        if (wps_er_send_get_device_info(ap, wps_er_ap_learn_m1) < 0)
                return -1;
 
-       /* TODO: add PIN without SetSelectedRegistrar trigger to all APs */
+       er->skip_set_sel_reg = 1;
        wps_registrar_add_pin(er->wps->registrar, NULL, uuid, pin, pin_len, 0);
+       er->skip_set_sel_reg = 0;
 
        return 0;
 }
@@ -1763,8 +1769,9 @@ int wps_er_config(struct wps_er *er, const u8 *uuid, const u8 *pin,
        if (wps_er_send_get_device_info(ap, wps_er_ap_config_m1) < 0)
                return -1;
 
-       /* TODO: add PIN without SetSelectedRegistrar trigger to all APs */
+       er->skip_set_sel_reg = 1;
        wps_registrar_add_pin(er->wps->registrar, NULL, uuid, pin, pin_len, 0);
+       er->skip_set_sel_reg = 0;
 
        return 0;
 }
index af07d5ec5184d2acbccb48e5a46f5b06395663a3..d51bd702527966e989cc393e18b36e7ee6ca4f33 100644 (file)
@@ -91,6 +91,7 @@ struct wps_er {
        void (*deinit_done_cb)(void *ctx);
        void *deinit_done_ctx;
        struct in_addr filter_addr;
+       int skip_set_sel_reg;
 };