diff --git a/src/agent.c b/src/agent.c index e26c77ce5bfe9af40d9883d2b45a8069dde8b829..1ca65a857141ddbd60098bf88da39623a63ca094 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 },