From 5c57a6e2788b556f3d21ed39b415bc7e8e5db5ab Mon Sep 17 00:00:00 2001
From: Jakob Olsson <jakob.olsson@iopsys.eu>
Date: Mon, 14 Aug 2023 10:10:10 +0200
Subject: [PATCH] change config disallow_bsta to disallow_bsta_profile

---
 src/config.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/config.c b/src/config.c
index af87ed6e..e5a68cc8 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1041,7 +1041,7 @@ static int cntlr_config_get_credentials(struct controller_config *c,
 		[CRED_KEY] = { .name = "key", .type = UCI_TYPE_STRING },
 		[CRED_VLAN] = { .name = "vid", .type = UCI_TYPE_STRING },
 		[CRED_TYPE] = { .name = "type", .type = UCI_TYPE_STRING },
-		[CRED_D_BSTA] = { .name = "disallow_bsta", .type = UCI_TYPE_LIST },
+		[CRED_D_BSTA] = { .name = "disallow_bsta_profile", .type = UCI_TYPE_LIST },
 		[CRED_ENABLED] = { .name = "enabled", .type = UCI_TYPE_STRING },
 		[CRED_VENDOR_IE] = { .name = "vendor_ie", .type = UCI_TYPE_LIST }
 	};
@@ -1173,7 +1173,13 @@ static int cntlr_config_get_credentials(struct controller_config *c,
 		struct uci_element *x;
 
 		uci_foreach_element(&tb[CRED_D_BSTA]->v.list, x) {
-			cred->disallow_bsta |= atoi(x->name);
+			uint8_t profile;
+
+			profile = atoi(x->name);
+			if (profile > 2)
+				continue;
+
+			cred->disallow_bsta |= profile;
 		}
 	}
 
-- 
GitLab