From 908e4c85b87b3fcb88258db475a89b62293637b9 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sun, 16 Jan 2022 22:24:40 +0100 Subject: [PATCH] lib: avoid pointless search for built-in IETF YANG This causes confusing/annoying log messages at startup otherwise: `YANG model "ietf-inet-types@*" "*@*"not embedded, trying external file` Signed-off-by: David Lamparter --- lib/yang.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/yang.c b/lib/yang.c index 1e241f049e..ef1cf898aa 100644 --- a/lib/yang.c +++ b/lib/yang.c @@ -49,6 +49,11 @@ static LY_ERR yang_module_imp_clb(const char *mod_name, const char *mod_rev, { struct yang_module_embed *e; + if (!strcmp(mod_name, "ietf-inet-types") || + !strcmp(mod_name, "ietf-yang-types")) + /* libyang has these built in, don't try finding them here */ + return LY_ENOTFOUND; + for (e = embeds; e; e = e->next) { if (e->sub_mod_name && submod_name) { if (strcmp(e->sub_mod_name, submod_name)) -- 2.39.5