From 94b30d021b13e9488f9c76e7ceece48c9a567321 Mon Sep 17 00:00:00 2001 From: Jakob Olsson <jakob.olsson@iopsys.eu> Date: Mon, 25 Nov 2024 17:25:16 +0100 Subject: [PATCH] re-send MLD Config Requests which have not been ACKed --- src/cntlr.c | 24 +++++++++++++++++++----- src/cntlr.h | 8 +++++++- src/cntlr_cmdu.c | 4 ++-- src/cntlr_map.c | 9 ++++++++- src/config.c | 6 ++++++ src/config.h | 4 ++++ 6 files changed, 46 insertions(+), 9 deletions(-) diff --git a/src/cntlr.c b/src/cntlr.c index 131b45bf..e9a54ce5 100644 --- a/src/cntlr.c +++ b/src/cntlr.c @@ -1950,20 +1950,18 @@ bool cntlr_check_config_diff(struct controller *c, uint8_t diff) trace("ap mld config changed\n"); /* send the ap mld config cmdu to the agent */ - list_for_each_entry(n, &c->nodelist, list) { + list_for_each_entry(n, &c->nodelist, list) cntlr_send_ap_mld_configuration_request(c, n); - } } - if ((diff & CONFIG_DIFF_BSTA_MLD)) { + if (diff & CONFIG_DIFF_BSTA_MLD) { struct node *n = NULL; trace("bsta mld config changed\n"); /* send the ap mld config cmdu to the agent */ - list_for_each_entry(n, &c->nodelist, list) { + list_for_each_entry(n, &c->nodelist, list) cntlr_send_bsta_mld_configuration_request(c, n); - } } #endif @@ -2101,7 +2099,23 @@ static void renew_nodes_configuration(struct controller *c) break; } +#if (EASYMESH_VERSION >= 6) + else if (timestamp_less_than(&node->last_apmld_ack, &c->cfg.last_apmld_change) && + timestamp_greater_than(&node->last_cmdu, &c->cfg.last_apmld_change)) { + + dbg("Found possibly unconfigured AP MLD node: "MACFMT"\n", MAC2STR(node->alid)); + + cntlr_send_ap_mld_configuration_request(c, node); + } else if (timestamp_less_than(&node->last_bstamld_ack, &c->cfg.last_bstamld_change) && + timestamp_greater_than(&node->last_cmdu, &c->cfg.last_bstamld_change)) { + + dbg("Found possibly unconfigured BSTA MLD node: "MACFMT"\n", MAC2STR(node->alid)); + + cntlr_send_bsta_mld_configuration_request(c, node); + } +#endif } + } static void combined_link_metric_periodic_collection(struct controller *c) diff --git a/src/cntlr.h b/src/cntlr.h index 6ad16e6b..1712f7bf 100644 --- a/src/cntlr.h +++ b/src/cntlr.h @@ -315,9 +315,15 @@ struct node { int max_aplink_num; int max_bstalink_num; int tid_link_caps; + + uint16_t apmldconf_mid; + struct timespec last_apmld_ack; /** timestamp of most-recent AP MLD Config request ACK received by the agent */ + + uint16_t bstamldconf_mid; + struct timespec last_bstamld_ack; /** timestamp of most-recent BSTA MLD Config request ACK received by the agent */ #endif - struct timespec last_tsp_seen; /** last seen tsp */ + struct timespec last_tsp_seen; /** last seen tsp */ struct timespec last_config; /** timestamp of most-recent config sent to agent */ struct timespec last_cmdu; /** timestamp of last CMDU received from agent */ diff --git a/src/cntlr_cmdu.c b/src/cntlr_cmdu.c index 1b7d2e74..701f45e9 100644 --- a/src/cntlr_cmdu.c +++ b/src/cntlr_cmdu.c @@ -789,7 +789,7 @@ int cntlr_send_bsta_mld_configuration_request(struct controller *c, struct node if (!cmdu) return -1; - send_cmdu(c, cmdu); + n->bstamldconf_mid = send_cmdu(c, cmdu); cmdu_free(cmdu); return 0; @@ -858,7 +858,7 @@ int cntlr_send_ap_mld_configuration_request(struct controller *c, struct node *n if (!cmdu) return -1; - send_cmdu(c, cmdu); + n->apmldconf_mid = send_cmdu(c, cmdu); cmdu_free(cmdu); return 0; diff --git a/src/cntlr_map.c b/src/cntlr_map.c index cfece29d..603e7dd2 100644 --- a/src/cntlr_map.c +++ b/src/cntlr_map.c @@ -1487,6 +1487,7 @@ int handle_1905_ack(void *cntlr, struct cmdu_buff *cmdu, struct node *n) struct controller *c = (struct controller *) cntlr; struct tlv *tv[1][TLV_MAXNUM] = {0}; + uint16_t mid = cmdu_get_mid(cmdu); int idx; trace("parsing 1905 ack |" MACFMT "|\n", MAC2STR(cmdu->origin)); @@ -1501,7 +1502,6 @@ int handle_1905_ack(void *cntlr, struct cmdu_buff *cmdu, struct node *n) while (idx < TLV_MAXNUM && tv[0][idx]) { struct tlv_error_code *data; struct tlv *t = (struct tlv *)tv[0][idx++]; - uint16_t mid = cmdu_get_mid(cmdu); struct sta *s; @@ -1526,6 +1526,13 @@ int handle_1905_ack(void *cntlr, struct cmdu_buff *cmdu, struct node *n) } } +#if (EASYMESH_VERSION >= 6) + if (mid == n->apmldconf_mid) + timestamp_update(&n->last_apmld_ack); + else if (mid == n->bstamldconf_mid) + timestamp_update(&n->last_bstamld_ack); +#endif + return 0; } diff --git a/src/config.c b/src/config.c index 678c6558..b2a9eb5d 100644 --- a/src/config.c +++ b/src/config.c @@ -2365,6 +2365,12 @@ uint8_t cntlr_config_reload(struct controller_config *cfg) if (diff & CONFIG_DIFF_CREDENTIALS || diff & CONFIG_DIFF_VLAN) timestamp_update(&cfg->last_change); +#if (EASYMESH_VERSION >= 6) + if (diff & CONFIG_DIFF_AP_MLD || diff & CONFIG_DIFF_PUNCT_BITMAP) + timestamp_update(&cfg->last_apmld_change); + if (diff & CONFIG_DIFF_BSTA_MLD) + timestamp_update(&cfg->last_bstamld_change); +#endif /* clean old lists */ diff --git a/src/config.h b/src/config.h index 6f7d8ff1..041c599c 100644 --- a/src/config.h +++ b/src/config.h @@ -268,6 +268,10 @@ struct controller_config { struct qos_control_config qos; #endif struct timespec last_change; /* timestamp of most recent config change */ +#if (EASYMESH_VERSION >= 6) + struct timespec last_apmld_change; /* timestamp of most recent apmld config change */ + struct timespec last_bstamld_change; /* timestamp of most recent bstamld config change */ +#endif }; struct controller; -- GitLab