From 885a0cdb062701ece2398c2192745e56b8c8a8f8 Mon Sep 17 00:00:00 2001
From: Anjan Chanda <anjan.chanda@iopsys.eu>
Date: Thu, 2 May 2019 13:03:10 +0200
Subject: [PATCH] fix encryption status when wep or disabled

---
 wifimngr.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/wifimngr.c b/wifimngr.c
index c30091f..da2cffc 100644
--- a/wifimngr.c
+++ b/wifimngr.c
@@ -252,8 +252,14 @@ static int wl_status(struct ubus_context *ctx, struct ubus_object *obj,
 	blobmsg_add_u32(&bb, "radio", isup);
 	blobmsg_add_string(&bb, "ssid", ssid);
 	blobmsg_add_string(&bb, "bssid", bssid);
-	blobmsg_add_string(&bb, "encryption",
+	if (enc == CIPHER_NONE)
+		blobmsg_add_string(&bb, "encryption", "DISABLED");
+	else if (!!(enc & CIPHER_WEP)) {
+		blobmsg_add_string(&bb, "encryption", "WEP");
+	} else {
+		blobmsg_add_string(&bb, "encryption",
 			etostr(auth, auth_buf, AUTH_MAX, auth_str));
+	}
 	blobmsg_add_u32(&bb, "frequency", (band == 1) ? 5 : 2);
 	blobmsg_add_u32(&bb, "channel", channel);
 	blobmsg_add_u32(&bb, "bandwidth", bandwidth);
-- 
GitLab