Call ys_populate_feature from if_feature_check

In some cases, the feature won't be populated yet, and therefore, we
will consider this feature as disabled.

Fixes #429
This commit is contained in:
Shmuel Hazan 2023-04-30 17:19:40 +03:00
parent 8732d118dd
commit b13917b2ac
6 changed files with 15 additions and 5 deletions

View file

@ -162,6 +162,11 @@ if_feature_check(clixon_yang_sub_parse_yacc *ife,
/* Check if this feature is enabled or not
* Continue loop to catch unbound features and make verdict at end
*/
cv = yang_cv_get(yfeat);
if (cv == NULL && ife->h) {
ys_populate_feature(ife->h, yfeat);
}
cv = yang_cv_get(yfeat);
if (cv == NULL || !cv_bool_get(cv)) /* disabled */
retval = 0;