mirror of
https://dev.iopsys.eu/bbf/icwmp.git
synced 2026-03-14 04:49:58 +01:00
Perform reboot after config file download
This commit is contained in:
parent
f8a67151f4
commit
ea78dfdd2a
1 changed files with 11 additions and 5 deletions
|
|
@ -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--;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue