Fixed: Accepted added subtrees containing lists with duplicate keys

This commit is contained in:
Olof hagsand 2020-10-08 15:15:22 +02:00
parent 8ae647c32b
commit 469cbe0d64
2 changed files with 12 additions and 1 deletions

View file

@ -62,6 +62,7 @@ Users may have to change how they access the system
### Corrected Bugs
* Fixed: Accepted added subtrees containing lists with duplicate keys.
* Fixed: [default state data returned with get-config](https://github.com/clicon/clixon/issues/140)
* Generalized default code for both config and state

View file

@ -846,7 +846,15 @@ check_list_unique_minmax(cxobj *xt,
}
if (keyw != Y_LIST)
continue;
/* Here only lists. test unique constraints */
/* Here new (first element) of lists only
* First check unique keys
*/
if ((ret = check_unique_list(x, xt, y, y, xret)) < 0)
goto done;
if (ret == 0)
goto fail;
/* Check if there is a unique constraint on the list
*/
yu = NULL;
while ((yu = yn_each(y, yu)) != NULL) {
if (yang_keyword_get(yu) != Y_UNIQUE)
@ -861,6 +869,8 @@ check_list_unique_minmax(cxobj *xt,
goto fail;
}
}
/* yprev if set, is a list that has been traversed
* This check is made in the loop as well - this is for the last list
*/