[PATCH v5 15/25] wpa_cli: handle IFNAME correctly for global iface
Janusz Dziedzic
janusz.dziedzic at tieto.com
Fri Mar 4 01:20:31 PST 2016
In case we are using wpa_cli to connect global UDP
interface, before we have "UNKNOWN COMMAND\n" string
as ifname. Change this to "unknown".
Signed-off-by: Janusz Dziedzic <janusz.dziedzic at tieto.com>
---
src/common/wpa_ctrl.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/common/wpa_ctrl.c b/src/common/wpa_ctrl.c
index 623c2a7..042914f 100644
--- a/src/common/wpa_ctrl.c
+++ b/src/common/wpa_ctrl.c
@@ -435,6 +435,8 @@ struct wpa_ctrl * wpa_ctrl_open(const char *ctrl_path)
if (wpa_ctrl_request(ctrl, "IFNAME", 6, buf, &len, NULL) == 0) {
buf[len] = '\0';
+ if (os_strcmp(buf, "UNKNOWN COMMAND\n") == 0)
+ os_snprintf(buf, len, "unknown");
ctrl->remote_ifname = os_strdup(buf);
}
--
1.9.1
More information about the Hostap
mailing list