Perform reboot after config file download

This commit is contained in:
Suvendhu Hansa 2026-02-24 18:49:00 +05:30
parent f8a67151f4
commit ea78dfdd2a

View file

@ -807,9 +807,15 @@ int apply_downloaded_file(struct download *pdownload, char *download_file_name,
remove(VENDOR_CONFIG_FILE);
}
if (err == CWMP_OK)
error = FAULT_CPE_NO_FAULT;
else if (err == CWMP_GEN_ERR) {
if (err == CWMP_OK) {
cwmp_reboot("VendorConfigApply");
if (error == FAULT_CPE_NO_FAULT) {
sleep(70);
error = FAULT_CPE_DOWNLOAD_FAIL_COMPLETE_DOWNLOAD;
snprintf(err_msg, sizeof(err_msg), "Failed to reboot after config apply");
CWMP_LOG(ERROR, "## Failed to reboot after config apply");
}
} else if (err == CWMP_GEN_ERR) {
error = FAULT_CPE_INTERNAL_ERROR;
snprintf(err_msg, sizeof(err_msg), "Failed to commit the config file changes");
} else if (err == -1) {
@ -841,8 +847,7 @@ int apply_downloaded_file(struct download *pdownload, char *download_file_name,
if (error == FAULT_CPE_NO_FAULT) {
set_rpc_parameter_key(pdownload->command_key);
if (pdownload->filetype == DOWNLOAD_FILETYPE_VENDOR_CONFIG ||
pdownload->filetype == DOWNLOAD_FILETYPE_WEB_CONTENT ||
if (pdownload->filetype == DOWNLOAD_FILETYPE_WEB_CONTENT ||
pdownload->filetype == DOWNLOAD_FILETYPE_STORED_FIRMWARE_IMAGE) {
bkp_session_delete_element((ltype == TYPE_DOWNLOAD) ? "download" : "schedule_download", pdownload->id);
@ -1028,6 +1033,7 @@ void cwmp_start_download(struct uloop_timeout *timeout)
CWMP_LOG(ERROR, "Error while applying the downloaded file: %s", download_file_name);
}
}
list_del(&(pdownload->list));
if (pdownload->scheduled_time != 0) {
count_download_queue--;