From 504967864df7e5600900a3f340e16ca15e0668e9 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Tue, 25 Jan 2022 15:37:11 +0100 Subject: [PATCH] - Fixed: More than one unknown/extension in combination with augment of extension resulted in extension being skipped. - print yang extension argument in yang-print functions. --- CHANGELOG.md | 3 +++ lib/src/clixon_yang.c | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd0d388b..a0bbbf6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,9 @@ ## 5.6.0 Expected: March 2022 +### Corrected Bugs +* Fixed: More than one unknown/extension in combination with augment of extension resulted in extension being skipped. + ## 5.5.0 20 January 2022 diff --git a/lib/src/clixon_yang.c b/lib/src/clixon_yang.c index c2459570..0a635307 100644 --- a/lib/src/clixon_yang.c +++ b/lib/src/clixon_yang.c @@ -1852,6 +1852,9 @@ yang_print_cbuf(cbuf *cb, else cprintf(cb, " %s", ys->ys_argument); } + if (ys->ys_cv){ + cprintf(cb, " %s", cv_string_get(ys->ys_cv)); + } if (ys->ys_len){ cprintf(cb, " {\n"); yang_print_cbuf(cb, ys, marginal+3); @@ -3777,8 +3780,8 @@ yang_extension_value(yang_stmt *ys, continue; if ((ret = yang_find_prefix_by_namespace(ymod, ns, &prefix)) < 0) goto done; - if (ret == 0) /* not found */ - goto ok; + if (ret == 0) /* not found (this may happen in augment and maybe should be treated otherwise) */ + continue; cbuf_reset(cb); cprintf(cb, "%s:%s", prefix, name); if (strcmp(yang_argument_get(yext), cbuf_get(cb)) != 0) @@ -3792,7 +3795,6 @@ yang_extension_value(yang_stmt *ys, (cv = yang_cv_get(yext)) != NULL) *value = cv_string_get(cv); } - ok: retval = 0; done: if (cb)