From: Jouni Malinen Date: Thu, 11 Aug 2011 13:51:40 +0000 (+0300) Subject: WPS: Fix default virt/phy pushbutton config method setting X-Git-Tag: hostap-1-bp~264 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59639fa11234a8f219a39601d1593537b871677e;p=thirdparty%2Fhostap.git WPS: Fix default virt/phy pushbutton config method setting Instead of always adding PHY PushButton config method, only add this if neither virtual nor physical push button is advertised. --- diff --git a/src/wps/wps_registrar.c b/src/wps/wps_registrar.c index 2d7f63240..062621470 100644 --- a/src/wps/wps_registrar.c +++ b/src/wps/wps_registrar.c @@ -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