summaryrefslogtreecommitdiffstats
path: root/lib/if.h
diff options
context:
space:
mode:
authorDinesh G Dutt <5016467+ddutt@users.noreply.github.com>2019-08-13 18:29:40 +0200
committerDinesh G Dutt <5016467+ddutt@users.noreply.github.com>2019-08-13 18:29:40 +0200
commitea7ec26162b248600626b81f8eddb74e6d059e36 (patch)
treec2b874936d13d6c1123804f5345cc4fdaf43e0cd /lib/if.h
parent zebra: Display master interface names, not ifindices (diff)
downloadfrr-ea7ec26162b248600626b81f8eddb74e6d059e36.tar.xz
frr-ea7ec26162b248600626b81f8eddb74e6d059e36.zip
zebra: Ensure master's ifname is known, even if slave comes up first
In if_netlink.c, when an interface structure, ifp, is first created, its possible for the master to come up after the slave interface does. This means, the slave interface has no way to display the master's ifname in show outputs. To fix this, we need to allow creation by ifindex instead of by ifname so that this issue is handled. Signed-off-by: Dinesh G Dutt<5016467+ddutt@users.noreply.github.com>
Diffstat (limited to 'lib/if.h')
-rw-r--r--lib/if.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/if.h b/lib/if.h
index 603c9c378..871e319f2 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -478,7 +478,9 @@ extern int if_cmp_name_func(const char *p1, const char *p2);
*/
extern void if_update_to_new_vrf(struct interface *, vrf_id_t vrf_id);
extern struct interface *if_create(const char *name, vrf_id_t vrf_id);
+extern struct interface *if_create_ifindex(ifindex_t ifindex, vrf_id_t vrf_id);
extern struct interface *if_lookup_by_index(ifindex_t, vrf_id_t vrf_id);
+extern struct interface *if_lookup_by_index_all_vrf(ifindex_t);
extern struct interface *if_lookup_exact_address(void *matchaddr, int family,
vrf_id_t vrf_id);
extern struct connected *if_lookup_address(void *matchaddr, int family,
@@ -493,6 +495,7 @@ size_t if_lookup_by_hwaddr(const uint8_t *hw_addr, size_t addrsz,
extern struct interface *if_lookup_by_name_all_vrf(const char *ifname);
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);
+extern struct interface *if_get_by_ifindex(ifindex_t ifindex, vrf_id_t vrf_id);
extern void if_set_index(struct interface *ifp, ifindex_t ifindex);
/* Delete the interface, but do not free the structure, and leave it in the