From c07577b42bad511ef4bc07c50ea7bd792000f1e2 Mon Sep 17 00:00:00 2001 From: Olof Hagsand Date: Fri, 29 Mar 2019 15:31:00 +0100 Subject: [PATCH] startup diff vector should be children of config root, not root itself --- apps/backend/backend_commit.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/backend/backend_commit.c b/apps/backend/backend_commit.c index 74c51360..e3e8f122 100644 --- a/apps/backend/backend_commit.c +++ b/apps/backend/backend_commit.c @@ -172,6 +172,7 @@ startup_common(clicon_handle h, int ret; modstate_diff_t *msd = NULL; cxobj *xt = NULL; + cxobj *x; /* If CLICON_XMLDB_MODSTATE is enabled, then get the db XML with * potentially non-matching module-state in msd @@ -198,8 +199,11 @@ startup_common(clicon_handle h, goto done; /* Handcraft transition with with only add tree */ td->td_target = xt; - if (cxvec_append(td->td_target, &td->td_avec, &td->td_alen) < 0) - goto done; + x = NULL; + while ((x = xml_child_each(td->td_target, x, CX_ELMNT)) != NULL){ + if (cxvec_append(x, &td->td_avec, &td->td_alen) < 0) + goto done; + } /* 4. Call plugin transaction start callbacks */ if (plugin_transaction_begin(h, td) < 0)