@@ -1286,7 +1286,7 @@ ly_path_compile_leafref(const struct ly_ctx *ctx, const struct lysc_node *ctx_no
12861286
12871287LY_ERR
12881288ly_path_eval_partial (const struct ly_path * path , const struct lyd_node * start , const struct lyxp_var * vars ,
1289- LY_ARRAY_COUNT_TYPE * path_idx , struct lyd_node * * match )
1289+ ly_bool with_opaq , LY_ARRAY_COUNT_TYPE * path_idx , struct lyd_node * * match )
12901290{
12911291 LY_ARRAY_COUNT_TYPE u ;
12921292 struct lyd_node * prev_node = NULL , * elem , * node = NULL , * target ;
@@ -1338,7 +1338,13 @@ ly_path_eval_partial(const struct ly_path *path, const struct lyd_node *start, c
13381338 }
13391339 } else {
13401340 /* we will use hashes to find one any/container/leaf instance */
1341- lyd_find_sibling_val (start , path [u ].node , NULL , 0 , & node );
1341+ if (lyd_find_sibling_val (start , path [u ].node , NULL , 0 , & node ) && with_opaq ) {
1342+ if (!lyd_find_sibling_opaq_next (start , path [u ].node -> name , & node ) &&
1343+ (lyd_node_module (node ) != path [u ].node -> module )) {
1344+ /* non-matching opaque node */
1345+ node = NULL ;
1346+ }
1347+ }
13421348 }
13431349
13441350 if (!node ) {
@@ -1390,7 +1396,7 @@ ly_path_eval(const struct ly_path *path, const struct lyd_node *start, const str
13901396 LY_ERR ret ;
13911397 struct lyd_node * m ;
13921398
1393- ret = ly_path_eval_partial (path , start , vars , NULL , & m );
1399+ ret = ly_path_eval_partial (path , start , vars , 0 , NULL , & m );
13941400
13951401 if (ret == LY_SUCCESS ) {
13961402 /* last node was found */
0 commit comments