Fixed: Do not check min/max constraints on state data in config validate code

This commit is contained in:
Olof hagsand 2020-09-08 13:25:28 +02:00
parent 2c96cf71ea
commit 1ef3c0db7a
3 changed files with 7 additions and 3 deletions

View file

@ -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.

View file

@ -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;

View file

@ -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