diff options
Diffstat (limited to 'zebra/interface.c')
| -rw-r--r-- | zebra/interface.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index 1eefe1339c..42e7c7bb18 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -190,6 +190,7 @@ if_unlink_per_ns (struct interface *ifp) { ifp->node->info = NULL; route_unlock_node(ifp->node); + ifp->node = NULL; } /* Look up an interface by identifier within a NS */ @@ -210,6 +211,23 @@ if_lookup_by_index_per_ns (struct zebra_ns *ns, u_int32_t ifindex) return ifp; } +/* Look up an interface by name within a NS */ +struct interface * +if_lookup_by_name_per_ns (struct zebra_ns *ns, const char *ifname) +{ + struct route_node *rn; + struct interface *ifp; + + for (rn = route_top (ns->if_table); rn; rn = route_next (rn)) + { + ifp = (struct interface *)rn->info; + if (ifp && strcmp (ifp->name, ifname) == 0) + return (ifp); + } + + return NULL; +} + const char * ifindex2ifname_per_ns (struct zebra_ns *zns, unsigned int ifindex) { @@ -1689,6 +1707,8 @@ link_param_cmd_set_float (struct interface *ifp, float *field, static void link_param_cmd_unset (struct interface *ifp, uint32_t type) { + if (ifp->link_params == NULL) + return; /* Unset field */ UNSET_PARAM(ifp->link_params, type); |
