summaryrefslogtreecommitdiffstats
path: root/zebra/interface.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@openbsd.org>2018-04-04 02:41:12 +0200
committerGitHub <noreply@github.com>2018-04-04 02:41:12 +0200
commit02031f109e411eff58c4c04abb6d5fb10e127b10 (patch)
tree2dc869ba9307b4fe7b99906b2bcd9fa8c1e5d0be /zebra/interface.c
parentMerge pull request #1894 from LabNConsulting/working/master/vtysh-not-enabled (diff)
parentzebra: delete interface that disappeared (diff)
downloadfrr-02031f109e411eff58c4c04abb6d5fb10e127b10.tar.xz
frr-02031f109e411eff58c4c04abb6d5fb10e127b10.zip
Merge pull request #1927 from pguibert6WIND/issue_1926
zebra: delete interface that disappeared
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index a011efd28..4f761a5e9 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -252,6 +252,30 @@ struct interface *if_lookup_by_name_per_ns(struct zebra_ns *ns,
return NULL;
}
+/* this function must be used only if the vrf backend
+ * is a netns backend
+ */
+struct interface *if_lookup_by_name_not_ns(ns_id_t ns_id,
+ const char *ifname)
+{
+ struct interface *ifp;
+ struct ns *ns;
+
+ RB_FOREACH (ns, ns_head, &ns_tree) {
+ if (ns->ns_id == ns_id)
+ continue;
+ /* if_delete_update has removed interface
+ * from zns->if_table
+ * so to look for interface, use the vrf list
+ */
+ ifp = if_lookup_by_name(ifname, (vrf_id_t)ns->ns_id);
+ if (!ifp)
+ continue;
+ return ifp;
+ }
+ return NULL;
+}
+
const char *ifindex2ifname_per_ns(struct zebra_ns *zns, unsigned int ifindex)
{
struct interface *ifp;