summaryrefslogtreecommitdiff
path: root/lib/yang.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/yang.c')
-rw-r--r--lib/yang.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/yang.c b/lib/yang.c
index b6884619d9..3dd2513a4b 100644
--- a/lib/yang.c
+++ b/lib/yang.c
@@ -100,13 +100,14 @@ RB_GENERATE(yang_modules, yang_module, entry, yang_module_compare)
struct yang_modules yang_modules = RB_INITIALIZER(&yang_modules);
-struct yang_module *yang_module_load(const char *module_name)
+struct yang_module *yang_module_load(const char *module_name,
+ const char **features)
{
struct yang_module *module;
const struct lys_module *module_info;
- module_info =
- ly_ctx_load_module(ly_native_ctx, module_name, NULL, NULL);
+ module_info = ly_ctx_load_module(ly_native_ctx, module_name, NULL,
+ features);
if (!module_info) {
flog_err(EC_LIB_YANG_MODULE_LOAD,
"%s: failed to load data model: %s", __func__,
@@ -130,8 +131,10 @@ struct yang_module *yang_module_load(const char *module_name)
void yang_module_load_all(void)
{
+ static const char * const all_features[] = { "*", NULL };
+
for (size_t i = 0; i < array_size(frr_native_modules); i++)
- yang_module_load(frr_native_modules[i]);
+ yang_module_load(frr_native_modules[i], (const char **)all_features);
}
struct yang_module *yang_module_find(const char *module_name)
@@ -625,7 +628,8 @@ struct lyd_node *yang_dnode_dup(const struct lyd_node *dnode)
{
struct lyd_node *dup = NULL;
LY_ERR err;
- err = lyd_dup_siblings(dnode, NULL, LYD_DUP_RECURSIVE, &dup);
+ err = lyd_dup_siblings(dnode, NULL,
+ LYD_DUP_RECURSIVE | LYD_DUP_WITH_FLAGS, &dup);
assert(!err);
return dup;
}