diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-05-02 21:52:09 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-05-02 21:52:09 +0200 |
commit | 05ba625af7cbeb08322a1ea761732521816245bd (patch) | |
tree | b5501ff31d67ec53a0da4935f59a17478b637255 /zebra | |
parent | Merge remote-tracking branch 'origin/stable/2.0' (diff) | |
parent | update doc of ubuntu 12.04 (diff) | |
download | frr-05ba625af7cbeb08322a1ea761732521816245bd.tar.xz frr-05ba625af7cbeb08322a1ea761732521816245bd.zip |
Merge remote-tracking branch 'origin/stable/3.0'
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/if_netlink.c | 2 | ||||
-rw-r--r-- | zebra/interface.c | 18 | ||||
-rw-r--r-- | zebra/interface.h | 1 | ||||
-rw-r--r-- | zebra/zebra_vrf.c | 1 |
4 files changed, 21 insertions, 1 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index 28538fabd..006fcf16f 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -746,7 +746,7 @@ netlink_link_change (struct sockaddr_nl *snl, struct nlmsghdr *h, } /* See if interface is present. */ - ifp = if_lookup_by_index_per_ns (zns, ifi->ifi_index); + ifp = if_lookup_by_name_per_ns (zns, name); if (h->nlmsg_type == RTM_NEWLINK) { diff --git a/zebra/interface.c b/zebra/interface.c index 1eefe1339..c3d303736 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) { diff --git a/zebra/interface.h b/zebra/interface.h index 6039e2d37..9f108760d 100644 --- a/zebra/interface.h +++ b/zebra/interface.h @@ -236,6 +236,7 @@ struct zebra_if extern struct interface *if_lookup_by_index_per_ns (struct zebra_ns *, u_int32_t); +extern struct interface *if_lookup_by_name_per_ns (struct zebra_ns *, const char *); extern struct interface *if_link_per_ns (struct zebra_ns *, struct interface *); extern const char *ifindex2ifname_per_ns (struct zebra_ns *, unsigned int); diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c index bc18ee586..6b3689105 100644 --- a/zebra/zebra_vrf.c +++ b/zebra/zebra_vrf.c @@ -265,6 +265,7 @@ zebra_vrf_delete (struct vrf *vrf) { route_unlock_node (rnode); list_delete_node (zebrad.mq->subq[i], lnode); + zebrad.mq->size--; } } } |