Parcourir la source

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.
Jouni Malinen il y a 13 ans
Parent
commit
59639fa112
1 fichiers modifiés avec 2 ajouts et 4 suppressions
  1. 2 4
      src/wps/wps_registrar.c

+ 2 - 4
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