]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/northbound.c
Merge pull request #13649 from donaldsharp/unlock_the_node_or_else
[mirror_frr.git] / lib / northbound.c
index 24f7ecd70c1819c4bf543cdb2df505132d33ebb6..775f6ff92f9494352f3dbe3c97f374887b2df392 100644 (file)
@@ -167,7 +167,7 @@ struct nb_node *nb_node_find(const char *path)
         * Use libyang to find the schema node associated to the path and get
         * the northbound node from there (snode private pointer).
         */
-       snode = lys_find_path(ly_native_ctx, NULL, path, 0);
+       snode = yang_find_snode(ly_native_ctx, path, 0);
        if (!snode)
                return NULL;
 
@@ -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";
@@ -2685,7 +2685,7 @@ void nb_validate_callbacks(void)
 }
 
 
-void nb_init(struct thread_master *tm,
+void nb_init(struct event_loop *tm,
             const struct frr_yang_module_info *const modules[],
             size_t nmodules, bool db_enabled)
 {
@@ -2745,8 +2745,7 @@ void nb_terminate(void)
        nb_nodes_delete();
 
        /* Delete the running configuration. */
-       hash_clean(running_config_entries, running_config_entry_free);
-       hash_free(running_config_entries);
+       hash_clean_and_free(&running_config_entries, running_config_entry_free);
        nb_config_free(running_config);
        pthread_mutex_destroy(&running_config_mgmt_lock.mtx);
 }