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);
 	}
 
