diff --git a/src/cntlr.c b/src/cntlr.c index 131b45bfe204b942dcfd7a92454c3ab912738c04..e9a54ce57cf34fcd86bb5d1ada59a49dc8fe87ab 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 6ad16e6bfb88771ed9e6ef6dd2bb97f1225ee9f1..1712f7bfec120d6005a2219ca9c60a957f46e922 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 1b7d2e749bf2028d7c5b8334346dff70f73ebc6c..701f45e93587d6d2c7e699b20a88e8b7e10e97cf 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 cfece29da8d78e845a73cc9bcb40d955709d8363..603e7dd24c276272dc34f3e4ee93473735d4fdad 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 678c65583fd634311accd444995c87b5a50cb8e7..b2a9eb5d5bb5718ab1f5f391f5f2984c7dbb8d98 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 6f7d8ff128321bd1bde4f453599ad6544d4847d1..041c599c6978184d51cfe6548d26741d52d2561f 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;