Skip to content
Snippets Groups Projects
Commit 04e8b9ab authored by Jakob Olsson's avatar Jakob Olsson
Browse files

invalidate AP entries with same SSID as an MLD without being a part of it

parent 514fb7da
No related branches found
No related tags found
1 merge request!402R6: send BSTA MLD Configuration Request on config change
Pipeline #183318 passed
...@@ -1972,8 +1972,19 @@ static void config_map_ap_to_mld(struct controller_config *cfg) ...@@ -1972,8 +1972,19 @@ static void config_map_ap_to_mld(struct controller_config *cfg)
list_for_each_entry_safe(cred, tmp, &cfg->aplist, list) { list_for_each_entry_safe(cred, tmp, &cfg->aplist, list) {
struct mld_credential *mld; struct mld_credential *mld;
if (cred->mld_id == 0) if (cred->mld_id == 0) {
if (cntlr_config_get_mld_by_ssid(cfg, (char *)cred->cred.ssid)) {
/** AP must not have same SSID as an MLD without
* being a part of it, discard entry
**/
cfg->num_bss--;
clean_vendor_ies(cred);
list_del(&cred->list);
free(cred);
}
continue; continue;
}
mld = cntlr_config_get_mld_by_id(cfg, cred->mld_id); mld = cntlr_config_get_mld_by_id(cfg, cred->mld_id);
if (mld) { if (mld) {
...@@ -2051,13 +2062,13 @@ uint8_t cntlr_policy_lists_diff(struct list_head *prev_policylist, ...@@ -2051,13 +2062,13 @@ uint8_t cntlr_policy_lists_diff(struct list_head *prev_policylist,
return diff; return diff;
} }
uint8_t cntlr_vendor_ies_diff(struct list_head *prev_credslist, uint8_t cntlr_vendor_ies_diff(struct controller_config *pcfg,
struct list_head *curr_credslist) struct controller_config *ccfg)
{ {
struct iface_credential *prev, *curr; struct iface_credential *prev, *curr;
uint8_t diff = 0; uint8_t diff = 0;
list_for_multiple_entry(prev, curr, prev_credslist, curr_credslist, list, list) { list_for_multiple_entry(prev, curr, &pcfg->aplist, &pcfg->aplist, list, list) {
if (prev->num_ven_ies != curr->num_ven_ies) { if (prev->num_ven_ies != curr->num_ven_ies) {
dbg("num of vendor ies differ\n"); dbg("num of vendor ies differ\n");
diff |= CONFIG_DIFF_CREDENTIALS; diff |= CONFIG_DIFF_CREDENTIALS;
...@@ -2091,10 +2102,28 @@ uint8_t cntlr_creds_diff(struct controller_config *cfg, ...@@ -2091,10 +2102,28 @@ uint8_t cntlr_creds_diff(struct controller_config *cfg,
{ {
uint8_t diff = 0; uint8_t diff = 0;
/* credentials diff */ /* credentials diff */
if (prev->num_bss != cfg->num_bss) { if (prev->num_bss != cfg->num_bss) {
#if (EASYMESH_VERSION >= 6)
int prev_num_affaps = 0;
int curr_num_affaps = 0;
struct mld_credential *mld;
list_for_each_entry(mld, &prev->mldlist, list)
prev_num_affaps += mld->num_affiliated_aps;
list_for_each_entry(mld, &cfg->mldlist, list)
curr_num_affaps += mld->num_affiliated_aps;
/** if only affiliated APs are different, then handle via
* AP/BSTA MLD Config Request messages
*/
if ((prev->num_bss - cfg->num_bss) != (prev_num_affaps - curr_num_affaps))
diff |= CONFIG_DIFF_CREDENTIALS;
#else
dbg("|%s:%d| number of credentials differed\n", __func__, __LINE__); dbg("|%s:%d| number of credentials differed\n", __func__, __LINE__);
diff |= CONFIG_DIFF_CREDENTIALS; diff |= CONFIG_DIFF_CREDENTIALS;
#endif
} else if (list_memcmp(&prev->aplist, &cfg->aplist, } else if (list_memcmp(&prev->aplist, &cfg->aplist,
struct iface_credential, struct iface_credential,
offsetof(struct iface_credential, list) offsetof(struct iface_credential, list)
...@@ -2115,27 +2144,57 @@ uint8_t cntlr_creds_diff(struct controller_config *cfg, ...@@ -2115,27 +2144,57 @@ uint8_t cntlr_creds_diff(struct controller_config *cfg,
#endif #endif
else { else {
/* compare vendor ie list */ /* compare vendor ie list */
diff |= cntlr_vendor_ies_diff(&prev->aplist, &cfg->aplist); diff |= cntlr_vendor_ies_diff(prev, cfg);
} }
return diff; return diff;
} }
#if (EASYMESH_VERSION >= 6) #if (EASYMESH_VERSION >= 6)
uint8_t cntlr_mld_id_diff(struct list_head *prev_credslist, uint8_t cntlr_mld_id_diff(struct controller_config *curr,
struct list_head *curr_credslist) struct controller_config *prev)
{ {
struct iface_credential *prev, *curr; struct iface_credential *prev_ap = NULL, *curr_ap = NULL;
struct mld_credential *prev_mld = NULL, *curr_mld = NULL;
uint8_t multi_ap = 0;
uint8_t diff = 0; uint8_t diff = 0;
list_for_multiple_entry(prev, curr, prev_credslist, curr_credslist, list, list) { list_for_multiple_entry(prev_mld, curr_mld, &prev->mldlist, &curr->mldlist, list, list) {
if (prev->mld_id != curr->mld_id) { if (prev_mld->multi_ap != curr_mld->multi_ap)
dbg("mld_id differ\n"); continue;
if (curr->multi_ap & 0x02)
diff |= CONFIG_DIFF_AP_MLD; if (prev_mld->num_affiliated_aps != curr_mld->num_affiliated_aps) {
else if (curr->multi_ap & 0x01) if (curr_mld->multi_ap & 0x01) {
diff |= CONFIG_DIFF_BSTA_MLD; diff |= CONFIG_DIFF_BSTA_MLD;
break; diff |= CONFIG_DIFF_AP_MLD;
multi_ap |= 0x01;
} else if (curr_mld->multi_ap & 0x02) {
diff |= CONFIG_DIFF_AP_MLD;
multi_ap |= 0x02;
}
}
}
if (diff == 0) {
/** TODO: if REMOVE an affiliated FBSS from MLD and MOVE
* affiliated BBSS from one MLD to another, DIFF_BSTA_MLD *MAY*
* not get set
**/
list_for_multiple_entry(prev_ap, curr_ap, &prev->aplist, &curr->aplist, list, list) {
/* skip mld type which had changed num affiliated APs */
if (prev_ap->multi_ap & multi_ap)
continue;
if (prev_ap->mld_id != curr_ap->mld_id) {
dbg("mld_id differ\n");
if (curr_ap->multi_ap & 0x02)
diff |= CONFIG_DIFF_AP_MLD;
else if (curr_ap->multi_ap & 0x01) {
diff |= CONFIG_DIFF_BSTA_MLD;
diff |= CONFIG_DIFF_AP_MLD;
}
break;
}
} }
} }
...@@ -2147,19 +2206,12 @@ uint8_t cntlr_mld_diff(struct controller_config *cfg, ...@@ -2147,19 +2206,12 @@ uint8_t cntlr_mld_diff(struct controller_config *cfg,
{ {
uint8_t diff = 0; uint8_t diff = 0;
/* Check ap sections for mld_id change */ if (prev->num_mlds != cfg->num_mlds)
diff |= cntlr_mld_id_diff(&prev->aplist, &cfg->aplist); diff |= CONFIG_DIFF_CREDENTIALS;
else {
/* TODO: revisit below checks */ /* Check ap sections for mld_id change */
//if (prev->num_mlds != cfg->num_mlds) { diff |= cntlr_mld_id_diff(cfg, prev);
// dbg("|%s:%d| number of MLD credentials differed\n", __func__, __LINE__); }
// diff |= CONFIG_DIFF_MLD;
//} else if (list_memcmp(&prev->mldlist, &cfg->mldlist,
// struct mld_credential,
// offsetof(struct mld_credential, list))) {
// dbg("|%s:%d| MLD credentials have changed\n", __func__, __LINE__);
// diff |= CONFIG_DIFF_MLD;
//}
return diff; return diff;
} }
......
...@@ -73,8 +73,9 @@ struct mld_credential { ...@@ -73,8 +73,9 @@ struct mld_credential {
uint16_t vlanid; uint16_t vlanid;
uint8_t multi_ap; uint8_t multi_ap;
bool enabled; bool enabled;
uint8_t num_affiliated_aps;
struct list_head list; struct list_head list;
uint8_t num_affiliated_aps;
}; };
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment