[PATCH 1/2] ctrl_iface: BSS command return FAIL on no data

Jonathan Afek jonathan at wizery.com
Wed Jun 8 12:01:37 PDT 2016


The BSS supplicant command returns a 0 len reply when failing to
pasrse some information for a BSS.
This patch make the function wpa_supplicant_ctrl_iface_bss()
return -1 on such cases instead of 0 and therefore the BSS command
will return FAIL.
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 at intel.com>
---
 wpa_supplicant/ctrl_iface.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 2ff47cb..401cd61 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -4560,6 +4560,8 @@ static int wpa_supplicant_ctrl_iface_bss(struct wpa_supplicant *wpa_s,
 		bss = dl_list_entry(next, struct wpa_bss, list_id);
 	} while (bss && len);
 
+	if (0 == ret)
+		return -1;
 	return ret;
 }
 
-- 
1.9.1




More information about the Hostap mailing list