diff --git a/docs/api/uci/cwmp.md b/docs/api/uci/cwmp.md index a5a6b9c..4ecbd05 100644 --- a/docs/api/uci/cwmp.md +++ b/docs/api/uci/cwmp.md @@ -427,7 +427,7 @@ -
keep_settings
+
fw_upgrade_keep_settings
boolean
no
1
diff --git a/schemas/uci/cwmp.json b/schemas/uci/cwmp.json index b720daf..d1d7455 100644 --- a/schemas/uci/cwmp.json +++ b/schemas/uci/cwmp.json @@ -342,7 +342,7 @@ "description": "If set to 1, it forces the connectivity over v4 IP address." }, { - "name": "keep_settings", + "name": "fw_upgrade_keep_settings", "type": "boolean", "required": "no", "default": "1", diff --git a/src/common.h b/src/common.h index ed5a01b..c3b7761 100644 --- a/src/common.h +++ b/src/common.h @@ -157,7 +157,7 @@ typedef struct config { bool http_disable_100continue; int cr_timeout; bool force_ipv4; - bool keep_settings; + bool fw_upgrade_keep_settings; } config; struct deviceid { diff --git a/src/config.c b/src/config.c index 543dfcb..6e72bee 100755 --- a/src/config.c +++ b/src/config.c @@ -89,7 +89,7 @@ static void config_get_cpe_elements(struct uci_section *s) [UCI_CPE_JSON_FORCED_INFORM_FILE] = { .name = "forced_inform_json", .type = UCI_TYPE_STRING }, [UCI_CPE_CON_REQ_TIMEOUT] = { .name = "cr_timeout", .type = UCI_TYPE_STRING }, [UCI_CPE_FORCE_IPV4] = { .name = "force_ipv4", .type = UCI_TYPE_STRING }, - [UCI_CPE_KEEP_SETTINGS] = { .name = "keep_settings", .type = UCI_TYPE_STRING } + [UCI_CPE_KEEP_SETTINGS] = { .name = "fw_upgrade_keep_settings", .type = UCI_TYPE_STRING } }; struct uci_option *cpe_tb[__MAX_NUM_UCI_CPE_ATTRS]; @@ -189,8 +189,8 @@ static void config_get_cpe_elements(struct uci_section *s) cwmp_main->conf.force_ipv4 = uci_str_to_bool(get_value_from_uci_option(cpe_tb[UCI_CPE_FORCE_IPV4])); CWMP_LOG(DEBUG, "CWMP CONFIG - cpe force ipv4 enable: %d", cwmp_main->conf.force_ipv4); - cwmp_main->conf.keep_settings = cpe_tb[UCI_CPE_KEEP_SETTINGS] ? uci_str_to_bool(get_value_from_uci_option(cpe_tb[UCI_CPE_KEEP_SETTINGS])) : true; - CWMP_LOG(DEBUG, "CWMP CONFIG - cpe keep settings enable: %d", cwmp_main->conf.keep_settings); + cwmp_main->conf.fw_upgrade_keep_settings = cpe_tb[UCI_CPE_KEEP_SETTINGS] ? uci_str_to_bool(get_value_from_uci_option(cpe_tb[UCI_CPE_KEEP_SETTINGS])) : true; + CWMP_LOG(DEBUG, "CWMP CONFIG - cpe keep settings enable: %d", cwmp_main->conf.fw_upgrade_keep_settings); } static void config_get_acs_elements(struct uci_section *s) diff --git a/src/download.c b/src/download.c index 6ad8972..a0a96d7 100644 --- a/src/download.c +++ b/src/download.c @@ -297,7 +297,7 @@ int cwmp_apply_firmware() struct blob_buf b = { 0 }; CWMP_MEMSET(&b, 0, sizeof(struct blob_buf)); blob_buf_init(&b, 0); - blobmsg_add_u8(&b, "keep", cwmp_main->conf.keep_settings); + blobmsg_add_u8(&b, "keep", cwmp_main->conf.fw_upgrade_keep_settings); CWMP_LOG(INFO, "Apply downloaded image ..."); e = icwmp_ubus_invoke("rpc-sys", "upgrade_start", b.head, NULL, NULL); diff --git a/test/files/etc/config/cwmp b/test/files/etc/config/cwmp index cd7ca82..ee947f6 100644 --- a/test/files/etc/config/cwmp +++ b/test/files/etc/config/cwmp @@ -37,7 +37,7 @@ config cpe 'cpe' option exec_download '0' option periodic_notify_enable '1' option periodic_notify_interval '10' - option keep_settings '1' + option fw_upgrade_keep_settings '1' config lwn 'lwn' option enable '1'