mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Fix ssid sync for out of bound updates
This commit is contained in:
parent
5b409cb46a
commit
09a3370be9
1 changed files with 14 additions and 5 deletions
|
|
@ -514,10 +514,23 @@ static void dmmap_synchronizeWiFiSSID(struct dmctx *dmctx, DMNODE *parent_node,
|
|||
uci_foreach_sections("wireless", "wifi-iface", s) {
|
||||
char *disabled = NULL, *ssid = NULL, *device = NULL;
|
||||
|
||||
dmuci_get_value_by_section_string(s, "disabled", &disabled);
|
||||
dmuci_get_value_by_section_string(s, "ssid", &ssid);
|
||||
dmuci_get_value_by_section_string(s, "device", &device);
|
||||
|
||||
// if dmmap section exits ==> skip it
|
||||
ss = get_dup_section_in_dmmap_opt("dmmap_wireless", "ssid", "ap_section_name", section_name(s));
|
||||
if (ss)
|
||||
if (ss) {
|
||||
char *dm_ssid = NULL;
|
||||
|
||||
dmuci_get_value_by_section_string(ss, "ssid", &dm_ssid);
|
||||
if (DM_STRCMP(dm_ssid, ssid)) { // if ssid does not match, sync it
|
||||
dmuci_set_value_by_section(ss, "enabled", DM_STRLEN(disabled) ? ((*disabled == '1') ? "0" : "1") : "1");
|
||||
dmuci_set_value_by_section(ss, "ssid", ssid);
|
||||
dmuci_set_value_by_section(ss, "device", device);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// section added by user ==> skip it
|
||||
ss = get_dup_section_in_dmmap("dmmap_wireless", "wifi-iface", section_name(s));
|
||||
|
|
@ -525,10 +538,6 @@ static void dmmap_synchronizeWiFiSSID(struct dmctx *dmctx, DMNODE *parent_node,
|
|||
if (DM_LSTRCMP(user_s, "1") == 0)
|
||||
continue;
|
||||
|
||||
dmuci_get_value_by_section_string(s, "disabled", &disabled);
|
||||
dmuci_get_value_by_section_string(s, "ssid", &ssid);
|
||||
dmuci_get_value_by_section_string(s, "device", &device);
|
||||
|
||||
dmuci_add_section_bbfdm("dmmap_wireless", "ssid", &ss);
|
||||
dmuci_set_value_by_section(ss, "ap_section_name", section_name(s));
|
||||
dmuci_set_value_by_section(ss, "enabled", DM_STRLEN(disabled) ? ((*disabled == '1') ? "0" : "1") : "1");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue