From 1da3b06b79014b50a7985a962bc71a2aad002030 Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Mon, 5 Aug 2024 13:33:11 +0200 Subject: [PATCH 1/2] schema compile BUGFIX avoid extension duplication in rpc in/out The extensions are compiled once in lys_compile_node_action_inout(), then another time in lys_compile_node_(), which adds the same extensions again. Remove the extension compilation from lys_compile_node_action_inout(). Signed-off-by: Olivier Matz --- src/schema_compile_node.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/schema_compile_node.c b/src/schema_compile_node.c index a6277998a..1405b8cf1 100644 --- a/src/schema_compile_node.c +++ b/src/schema_compile_node.c @@ -2794,7 +2794,6 @@ lys_compile_node_action_inout(struct lysc_ctx *ctx, struct lysp_node *pnode, str struct lysc_node_action_inout *inout = (struct lysc_node_action_inout *)node; COMPILE_ARRAY_GOTO(ctx, inout_p->musts, inout->musts, lys_compile_must, ret, done); - COMPILE_EXTS_GOTO(ctx, inout_p->exts, inout->exts, inout, ret, done); ctx->compile_opts |= (inout_p->nodetype == LYS_INPUT) ? LYS_COMPILE_RPC_INPUT : LYS_COMPILE_RPC_OUTPUT; LY_LIST_FOR(inout_p->child, child_p) { From 0bc94c0a5ea17b19bb4f40483046ff08204d3f20 Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Mon, 5 Aug 2024 13:35:16 +0200 Subject: [PATCH 2/2] printer_yang BUGFIX display of extensions for rpc in/out Fix the substatement passed to yprp_extension_instances() from yprp_inout(). Signed-off-by: Olivier Matz --- src/printer_yang.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/printer_yang.c b/src/printer_yang.c index 6dc06a884..67c94d91b 100644 --- a/src/printer_yang.c +++ b/src/printer_yang.c @@ -1162,7 +1162,7 @@ yprp_inout(struct lys_ypr_ctx *pctx, const struct lysp_node_action_inout *inout, ly_print_(pctx->out, "%*s%s {\n", INDENT, inout->name); LEVEL++; - yprp_extension_instances(pctx, LY_STMT_MUST, 0, inout->exts, NULL); + yprp_extension_instances(pctx, lyplg_ext_nodetype2stmt(inout->nodetype), 0, inout->exts, NULL); LY_ARRAY_FOR(inout->musts, u) { yprp_restr(pctx, &inout->musts[u], LY_STMT_MUST, NULL); }