diff --git a/CHANGELOG.md b/CHANGELOG.md index a9ebecf7..8f06872d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ Developers may need to change their code ### Corrected Bugs +* Fixed: Do not check min/max constraints on state data in config validate code * Fixed: [min-elements attribute prevents from deleting list entries #133](https://github.com/clicon/clixon/issues/133) * Fixed: [xmldb_get0 returns invalid candidate on startup transaction callbacks #126](https://github.com/clicon/clixon/issues/126). Always clear candidate-db before db initialization. * Fixed: YANG `uses` statements in sub-modules did not search for `grouping` statements in other submodules of the module it belongs to. diff --git a/lib/src/clixon_validate.c b/lib/src/clixon_validate.c index 5604b4d6..0872588e 100644 --- a/lib/src/clixon_validate.c +++ b/lib/src/clixon_validate.c @@ -824,6 +824,7 @@ check_list_unique_minmax(cxobj *xt, yprev = y; /* Restart min/max count */ continue; } + /* Here only (leaf)lists */ if (yprev != NULL){ /* There exists a previous (leaf)list */ if (y == yprev){ /* If same yang as previous x, then skip (eg same list) */ nr++; @@ -849,7 +850,8 @@ check_list_unique_minmax(cxobj *xt, ye = yn_each(yt, ye); if (ye && ych != ye) do { - if (yang_keyword_get(ye) == Y_LIST || yang_keyword_get(ye) == Y_LEAF_LIST){ + if (yang_config(ye) == 1 && + (yang_keyword_get(ye) == Y_LIST || yang_keyword_get(ye) == Y_LEAF_LIST)){ /* Check if the list length violates min/max */ if ((ret = check_min_max(xt, ye, 0, xret)) < 0) goto done; @@ -892,7 +894,8 @@ check_list_unique_minmax(cxobj *xt, */ if ((ye = yn_each(yt, ye)) != NULL) do { - if (yang_keyword_get(ye) == Y_LIST || yang_keyword_get(ye) == Y_LEAF_LIST){ + if (yang_config(ye) == 1 && + (yang_keyword_get(ye) == Y_LIST || yang_keyword_get(ye) == Y_LEAF_LIST)){ /* Check if the list length violates min/max */ if ((ret = check_min_max(xt, ye, 0, xret)) < 0) goto done; diff --git a/lib/src/clixon_yang.c b/lib/src/clixon_yang.c index b5f98ca1..e24c5fbb 100644 --- a/lib/src/clixon_yang.c +++ b/lib/src/clixon_yang.c @@ -2707,7 +2707,7 @@ yang_config(yang_stmt *ys) return 1; } -/*! Return config state of this node taking parents/anceestors into account +/*! Return config state of this node taking parents/ancestors into account * * config statement is default true. * @param[in] ys Yang statement