[PATCH 1/6] ctrl_iface: BSS command return FAIL on failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The BSS supplicant command returns a 0 len reply on a failure
when the BSS isn't in the DB or if the command has invalid params.
This patch make the function wpa_supplicant_ctrl_iface_bss()
return -1 on failures instead of 0 and therefore the BSS command
will return FAIL on failures.
This is important since when using udp control interfaces
sending a 0 len reply does not send a reply at all and the
control interface can wait forever (or until a timeout is reached)
for a reply.

Signed-off-by: Jonathan Afek <jonathanx.afek@xxxxxxxxx>
---
 wpa_supplicant/ctrl_iface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index e75f1ae..2ff47cb 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -4448,7 +4448,7 @@ static int wpa_supplicant_ctrl_iface_bss(struct wpa_supplicant *wpa_s,
 			if ((ctmp = os_strchr(cmd + 6, '-')) == NULL) {
 				wpa_printf(MSG_INFO, "Wrong BSS range "
 					   "format");
-				return 0;
+				return -1;
 			}
 
 			if (*(cmd + 6) == '-')
@@ -4530,7 +4530,7 @@ static int wpa_supplicant_ctrl_iface_bss(struct wpa_supplicant *wpa_s,
 	}
 
 	if (bss == NULL)
-		return 0;
+		return -1;
 
 	if (bsslast == NULL)
 		bsslast = bss;
-- 
1.9.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux