]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2PS: Correct config_methods for different P2P cases
authorPurushottam Kushwaha <pkushwah@qti.qualcomm.com>
Fri, 29 Apr 2016 10:46:44 +0000 (16:16 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 19 May 2016 16:16:10 +0000 (19:16 +0300)
Add P2PS config flag only when config_methods are set. This restores the
pre-P2PS behavioer for the cases where Display or Keypad config method
is specified for a peer (i.e., do not add the new P2PS method in that
case).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/p2p/p2p_build.c

index 793d28ba7bdd2a20efbd84f385898fd4c9dc5b98..2882c6ad02e7eb85fff43224b8c2013d05fc95a1 100644 (file)
@@ -202,11 +202,11 @@ void p2p_buf_add_device_info(struct wpabuf *buf, struct p2p_data *p2p,
        if (peer && peer->wps_method != WPS_NOT_READY) {
                if (peer->wps_method == WPS_PBC)
                        methods |= WPS_CONFIG_PUSHBUTTON;
+               else if (peer->wps_method == WPS_P2PS)
+                       methods |= WPS_CONFIG_P2PS;
                else if (peer->wps_method == WPS_PIN_DISPLAY ||
-                        peer->wps_method == WPS_PIN_KEYPAD) {
+                        peer->wps_method == WPS_PIN_KEYPAD)
                        methods |= WPS_CONFIG_DISPLAY | WPS_CONFIG_KEYPAD;
-                       methods |= WPS_CONFIG_P2PS;
-               }
        } else if (p2p->cfg->config_methods) {
                methods |= p2p->cfg->config_methods &
                        (WPS_CONFIG_PUSHBUTTON | WPS_CONFIG_DISPLAY |