]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: make if_lookup_by_name_all_vrf internal
authorIgor Ryzhov <iryzhov@nfware.com>
Thu, 14 Oct 2021 18:06:38 +0000 (21:06 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Fri, 15 Oct 2021 00:44:42 +0000 (03:44 +0300)
This function doesn't work correctly with netns VRF backend as the same
ifname may be used in multiple netns simultaneously. So let's hide it
from the public API to reduce temptation to use it instead of writing
the correct code.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
lib/if.c
lib/if.h

index 4d7862022c4879081cf33c1a88de6c8b39adbd4d..446b40fb46b2ae2e263caf1b163917f8f8ada72c 100644 (file)
--- a/lib/if.c
+++ b/lib/if.c
@@ -431,7 +431,7 @@ struct interface *if_lookup_by_name_vrf(const char *name, struct vrf *vrf)
        return RB_FIND(if_name_head, &vrf->ifaces_by_name, &if_tmp);
 }
 
-struct interface *if_lookup_by_name_all_vrf(const char *name)
+static struct interface *if_lookup_by_name_all_vrf(const char *name)
 {
        struct vrf *vrf;
        struct interface *ifp;
index 59e75d8b6885b9f10ba5e1ac23fe28aba3b3e7ef..60d571b54e2d193e97fb565385ce0f236be2b448 100644 (file)
--- a/lib/if.h
+++ b/lib/if.h
@@ -529,7 +529,6 @@ size_t if_lookup_by_hwaddr(const uint8_t *hw_addr, size_t addrsz,
                           struct interface ***result, vrf_id_t vrf_id);
 
 struct vrf;
-extern struct interface *if_lookup_by_name_all_vrf(const char *ifname);
 extern struct interface *if_lookup_by_name_vrf(const char *name, struct vrf *vrf);
 extern struct interface *if_lookup_by_name(const char *ifname, vrf_id_t vrf_id);
 extern struct interface *if_get_by_name(const char *ifname, vrf_id_t vrf_id);