From 3a5d3272c91db6a2579fda11fd28d79a73e77e30 Mon Sep 17 00:00:00 2001
From: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
Date: Tue, 20 May 2025 12:05:34 +0200
Subject: [PATCH] send pref report when cac-start/cac-end

---
 src/agent.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/agent.c b/src/agent.c
index e26c77ce5..1ca65a857 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -2265,9 +2265,6 @@ static void wifi_cac_event_handler(void *c, struct blob_attr *msg)
 	struct wifi_radio_element *radio;
 	char *ifname, *event;
 
-	if (!a->cfg.ap_follow_sta_dfs)
-		return;
-
 	blobmsg_parse(ev_attr, ARRAY_SIZE(ev_attr), tb, blob_data(msg), blob_len(msg));
 	if (!tb[0] || !tb[1] || !tb[2])
 		return;
@@ -2279,6 +2276,13 @@ static void wifi_cac_event_handler(void *c, struct blob_attr *msg)
 	if (!radio)
 		return;
 
+	/* Update preferences - send CMDU when changed */
+	if (!strcmp(event, "cac-start") || !strcmp(event, "cac-end"))
+		wifi_radio_update_opclass_preferences(a, radio, 1);
+
+	if (!a->cfg.ap_follow_sta_dfs)
+		return;
+
 	if (!strcmp(event, "cac-end")) {
 		static const struct blobmsg_policy data_attr[] = {
 			[0] = { .name = "success", .type = BLOBMSG_TYPE_STRING },
-- 
GitLab