Fixed: unknown nodes (for extenstions) did not work when placed directly under a grouping clause

This commit is contained in:
Olof hagsand 2021-01-28 09:02:29 +01:00
parent f5f013c739
commit 0b1e4ab0e9
2 changed files with 4 additions and 3 deletions

View file

@ -80,6 +80,7 @@ Users may have to change how they access the system
### Corrected Bugs ### Corrected Bugs
* Fixed: unknown nodes (for extenstions) did not work when placed directly under a grouping clause
* Fixed: [Behaviour of Empty LIST Input in RESTCONF JSON #166](https://github.com/clicon/clixon/issues/166) * Fixed: [Behaviour of Empty LIST Input in RESTCONF JSON #166](https://github.com/clicon/clixon/issues/166)
* Netconf split lines input (input fragments) fixed * Netconf split lines input (input fragments) fixed
* Netconf input split on several lines, eg using stdin: "<a>\nfoo</a>]]>]]>" could under some circumstances be split so that only "</a>]]>]]>" be properly processed. This could also happen to a socket receiving a sub-string and then after a delay receive the rest. * Netconf input split on several lines, eg using stdin: "<a>\nfoo</a>]]>]]>" could under some circumstances be split so that only "</a>]]>]]>" be properly processed. This could also happen to a socket receiving a sub-string and then after a delay receive the rest.

View file

@ -530,13 +530,13 @@ yang_expand_grouping(yang_stmt *yn)
if ((ygrouping2 = ys_dup(ygrouping)) == NULL) if ((ygrouping2 = ys_dup(ygrouping)) == NULL)
goto done; goto done;
/* Only replace data/schemanodes: /* Only replace data/schemanodes and unknowns:
* Compute the number of such nodes, and extend the child vector with that below * Compute the number of such nodes, and extend the child vector with that below
*/ */
glen = 0; glen = 0;
yg = NULL; yg = NULL;
while ((yg = yn_each(ygrouping2, yg)) != NULL) { while ((yg = yn_each(ygrouping2, yg)) != NULL) {
if (yang_schemanode(yg)) if (yang_schemanode(yg) || yang_keyword_get(yg) == Y_UNKNOWN)
glen++; glen++;
} }
/* /*
@ -584,7 +584,7 @@ yang_expand_grouping(yang_stmt *yn)
for (j=0; j<yang_len_get(ygrouping2); j++){ for (j=0; j<yang_len_get(ygrouping2); j++){
yg = ygrouping2->ys_stmt[j]; /* Child of refined copy */ yg = ygrouping2->ys_stmt[j]; /* Child of refined copy */
/* Only replace data/schemanodes */ /* Only replace data/schemanodes */
if (!yang_schemanode(yg)){ if (!yang_schemanode(yg) && yang_keyword_get(yg) != Y_UNKNOWN){
ys_free(yg); ys_free(yg);
continue; continue;
} }