diff --git a/dmtree/tr181/wifi.c b/dmtree/tr181/wifi.c index 291985fc..ae8ba86b 100644 --- a/dmtree/tr181/wifi.c +++ b/dmtree/tr181/wifi.c @@ -666,7 +666,7 @@ static int browseWiFiDataElementsNetworkSSIDInst(struct dmctx *dmctx, DMNODE *pa synchronize_specific_config_sections_with_dmmap("mapcontroller", "ap", "dmmap_mapcontroller", &dup_list); list_for_each_entry(p, &dup_list, list) { char *type = NULL; - char *disabled = NULL; + char *enabled = NULL; bool b = false; dmuci_get_value_by_section_string(p->config_section, "type", &type); @@ -674,10 +674,12 @@ static int browseWiFiDataElementsNetworkSSIDInst(struct dmctx *dmctx, DMNODE *pa continue; // skip the disabled fronthaul interfaces - dmuci_get_value_by_section_string(p->config_section, "disabled", &disabled); - string_to_bool(disabled, &b); - if (b == true) - continue; + dmuci_get_value_by_section_string(p->config_section, "enabled", &enabled); + if (DM_STRLEN(enabled)) { + string_to_bool(enabled, &b); + if (b == false) + continue; + } inst = handle_instance(dmctx, parent_node, p->dmmap_section, "wifi_da_ssid_instance", "wifi_da_ssid_alias"); @@ -5988,7 +5990,7 @@ static int operate_WiFiDataElementsNetwork_SetSSID(char *refparam, struct dmctx dmuci_get_value_by_section_string(s, "ssid", &curr_ssid); dmuci_get_value_by_section_string(s, "band", &curr_band); if (DM_STRCMP(curr_ssid, ssid) == 0 && DM_STRNCMP(curr_band, band, 1) == 0) { - dmuci_set_value_by_section(s, "disabled", "0"); + dmuci_set_value_by_section(s, "enabled", "1"); if (*key) dmuci_set_value_by_section(s, "key", key); ssid_exist = true; break; @@ -6001,7 +6003,7 @@ static int operate_WiFiDataElementsNetwork_SetSSID(char *refparam, struct dmctx dmuci_set_value_by_section(s, "key", key); dmuci_set_value_by_section(s, "type", "fronthaul"); dmuci_set_value_by_section(s, "band", (*band == '5') ? "5" : "2"); - dmuci_set_value_by_section(s, "disabled", "0"); + dmuci_set_value_by_section(s, "enabled", "1"); } } else { @@ -6010,7 +6012,7 @@ static int operate_WiFiDataElementsNetwork_SetSSID(char *refparam, struct dmctx dmuci_get_value_by_section_string(s, "ssid", &curr_ssid); dmuci_get_value_by_section_string(s, "band", &curr_band); if (DM_STRCMP(curr_ssid, ssid) == 0 && DM_STRNCMP(curr_band, band, 1) == 0) { - dmuci_set_value_by_section(s, "disabled", "1"); + dmuci_set_value_by_section(s, "enabled", "0"); ssid_exist = true; break; }