diff options
| author | Quentin Young <qlyoung@users.noreply.github.com> | 2019-04-22 15:10:34 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-22 15:10:34 -0400 |
| commit | 0b4f815088bca6d42225c034e590dfd007499964 (patch) | |
| tree | cf87cb68c2740100a0e32b30fb0cea3dfb9ebba0 /lib/if.c | |
| parent | c6f637132fc482b782d47f943849a3272f07c0da (diff) | |
| parent | ccd43ada1791793602cbdff3973fae3ca692e6bf (diff) | |
Merge pull request #4161 from opensourcerouting/nb-performance
lib: rework management of user pointers in the northbound layer
Diffstat (limited to 'lib/if.c')
| -rw-r--r-- | lib/if.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1303,7 +1303,7 @@ static int lib_interface_create(enum nb_event event, #else ifp = if_get_by_name(ifname, vrf->vrf_id); #endif /* SUNOS_5 */ - yang_dnode_set_entry(dnode, ifp); + nb_running_set_entry(dnode, ifp); break; } @@ -1315,10 +1315,10 @@ static int lib_interface_destroy(enum nb_event event, { struct interface *ifp; - ifp = yang_dnode_get_entry(dnode, true); switch (event) { case NB_EV_VALIDATE: + ifp = nb_running_get_entry(dnode, NULL, true); if (CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE)) { zlog_warn("%s: only inactive interfaces can be deleted", __func__); @@ -1329,6 +1329,7 @@ static int lib_interface_destroy(enum nb_event event, case NB_EV_ABORT: break; case NB_EV_APPLY: + ifp = nb_running_unset_entry(dnode); if_delete(ifp); break; } @@ -1349,7 +1350,7 @@ static int lib_interface_description_modify(enum nb_event event, if (event != NB_EV_APPLY) return NB_OK; - ifp = yang_dnode_get_entry(dnode, true); + ifp = nb_running_get_entry(dnode, NULL, true); XFREE(MTYPE_TMP, ifp->desc); description = yang_dnode_get_string(dnode, NULL); ifp->desc = XSTRDUP(MTYPE_TMP, description); @@ -1365,7 +1366,7 @@ static int lib_interface_description_destroy(enum nb_event event, if (event != NB_EV_APPLY) return NB_OK; - ifp = yang_dnode_get_entry(dnode, true); + ifp = nb_running_get_entry(dnode, NULL, true); XFREE(MTYPE_TMP, ifp->desc); return NB_OK; |
