]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: fix broken "show yang operational-data" functionality
authorChristian Hopps <chopps@labn.net>
Mon, 17 Apr 2023 05:16:32 +0000 (01:16 -0400)
committerChristian Hopps <chopps@labn.net>
Mon, 17 Apr 2023 05:43:48 +0000 (01:43 -0400)
Previously was using an API that returned the root of the data tree given the
users input xpath value, and then used it like it was the leaf node (last not
first). So basically this CLI command only worked when one requested the root
node of the model.

Signed-off-by: Christian Hopps <chopps@labn.net>
lib/northbound.c

index ba9b6d59b4ac7048b845fcffd8a3eb35a9a0f918..775f6ff92f9494352f3dbe3c97f374887b2df392 100644 (file)
@@ -2129,8 +2129,8 @@ int nb_oper_data_iterate(const char *xpath, struct yang_translator *translator,
         * all YANG lists (if any).
         */
 
-       LY_ERR err = lyd_new_path(NULL, ly_native_ctx, xpath, NULL,
-                                 LYD_NEW_PATH_UPDATE, &dnode);
+       LY_ERR err = lyd_new_path2(NULL, ly_native_ctx, xpath, NULL, 0, 0,
+                                  LYD_NEW_PATH_UPDATE, NULL, &dnode);
        if (err || !dnode) {
                const char *errmsg =
                        err ? ly_errmsg(ly_native_ctx) : "node not found";