]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Fix default virt/phy pushbutton config method setting
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 11 Aug 2011 13:51:40 +0000 (16:51 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 11 Aug 2011 13:51:40 +0000 (16:51 +0300)
Instead of always adding PHY PushButton config method, only add this
if neither virtual nor physical push button is advertised.

src/wps/wps_registrar.c

index 2d7f6324053cfc4b2fa1c141e8bf76a582fcc354..062621470d5c39663eacaba0aee82694f2713283 100644 (file)
@@ -485,10 +485,8 @@ static void wps_set_pushbutton(u16 *methods, u16 conf_methods)
                *methods |= WPS_CONFIG_VIRT_PUSHBUTTON;
        if (conf_methods & WPS_CONFIG_PHY_PUSHBUTTON)
                *methods |= WPS_CONFIG_PHY_PUSHBUTTON;
-       if ((*methods & WPS_CONFIG_VIRT_PUSHBUTTON) !=
-           WPS_CONFIG_VIRT_PUSHBUTTON ||
-           (*methods & WPS_CONFIG_PHY_PUSHBUTTON) !=
-           WPS_CONFIG_PHY_PUSHBUTTON) {
+       if (!(*methods & (WPS_CONFIG_VIRT_PUSHBUTTON |
+                         WPS_CONFIG_PHY_PUSHBUTTON))) {
                /*
                 * Required to include virtual/physical flag, but we were not
                 * configured with push button type, so have to default to one