diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-03-10 15:45:28 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-03-15 10:26:53 -0400 |
| commit | 7e2b760345f2dc43d9fc5381617ac4acc1cfd1d1 (patch) | |
| tree | 7bd585227cb8666a15d3920ca13a1f44560b6360 /lib/if.c | |
| parent | 93f681fa135ca65747190e5f36e720a217cfd163 (diff) | |
*: Remove non-vrf based ifindex lookup
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/if.c')
| -rw-r--r-- | lib/if.c | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -239,7 +239,7 @@ if_add_hook (int type, int (*func)(struct interface *ifp)) /* Interface existance check by index. */ struct interface * -if_lookup_by_index_vrf (ifindex_t ifindex, vrf_id_t vrf_id) +if_lookup_by_index (ifindex_t ifindex, vrf_id_t vrf_id) { struct listnode *node; struct interface *ifp; @@ -252,18 +252,12 @@ if_lookup_by_index_vrf (ifindex_t ifindex, vrf_id_t vrf_id) return NULL; } -struct interface * -if_lookup_by_index (ifindex_t ifindex) -{ - return if_lookup_by_index_vrf (ifindex, VRF_DEFAULT); -} - const char * ifindex2ifname_vrf (ifindex_t ifindex, vrf_id_t vrf_id) { struct interface *ifp; - return ((ifp = if_lookup_by_index_vrf (ifindex, vrf_id)) != NULL) ? + return ((ifp = if_lookup_by_index (ifindex, vrf_id)) != NULL) ? ifp->name : "unknown"; } @@ -1188,7 +1182,7 @@ ifaddr_ipv4_lookup (struct in_addr *addr, ifindex_t ifindex) return ifp; } else - return if_lookup_by_index(ifindex); + return if_lookup_by_index(ifindex, VRF_DEFAULT); } #endif /* ifaddr_ipv4_table */ |
