Add config in modified_uci list if delta exists

This commit is contained in:
Suvendhu Hansa 2026-01-29 15:51:37 +05:30
parent d39873cef6
commit 90a6281da6
3 changed files with 25 additions and 5 deletions

9
libbbfdm-api/legacy/dmuci.c Normal file → Executable file
View file

@ -795,10 +795,13 @@ static int __uci_perform_op(int operation, bbfdm_uci_op_data *op_data)
return -1;
}
if (uci_save(op_data->ucictx, ptr.p) != UCI_OK)
return -1;
if (ptr.p && !uci_list_empty(&ptr.p->delta)) {
if (uci_save(op_data->ucictx, ptr.p) != UCI_OK)
return -1;
add_list_modified_uci(op_data->dmctx, op_data->ucictx->confdir, op_data->package);
}
add_list_modified_uci(op_data->dmctx, op_data->ucictx->confdir, op_data->package);
return 0;
}

View file

@ -313,8 +313,6 @@ static int bbfdm_instances_handler(struct ubus_context *ctx, struct ubus_object
fill_optional_data(&data, tb[DM_INSTANCES_OPTIONAL]);
bbfdm_refresh_references(data.bbf_ctx.dm_type, obj->name);
bbfdm_get(&data, BBF_INSTANCES);
free_path_list(&paths_list);

View file

@ -19,8 +19,27 @@ void bbfdm_get(bbfdm_data_t *data, int method)
struct pathNode *pn = NULL;
int fault = 0;
LIST_HEAD(temp_list);
if (method == BBF_INSTANCES) {
// referesh reference db
struct dmctx bbf_ctx = {
.in_param = ROOT_NODE,
.dm_type = data->bbf_ctx.dm_type
};
bbf_init(&bbf_ctx);
bbfdm_cmd_exec(&bbf_ctx, BBF_REFERENCES_DB);
list_splice_tail_init(bbf_ctx.modified_uci_head, &temp_list);
bbf_cleanup(&bbf_ctx);
}
bbf_init(&data->bbf_ctx);
if (!list_empty(&temp_list)) {
list_splice_tail_init(&temp_list, data->bbf_ctx.modified_uci_head);
}
void *array = blobmsg_open_array(&data->bbf_ctx.bb, "results");
list_for_each_entry(pn, data->plist, list) {