mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 12:19:22 +00:00
zebra: Separate interface address lookup
Separate interface lookup into its own function. We need to know interfaces for reading in nexthop information, but we need to know nexthops for reading in the interface addresses. We will read in nexthops between the two. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
This commit is contained in:
parent
347bb8e269
commit
d2bec88a36
@ -807,6 +807,23 @@ int interface_lookup_netlink(struct zebra_ns *zns)
|
||||
|
||||
/* fixup linkages */
|
||||
zebra_if_update_all_links();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* interface_addr_lookup_netlink() - Look up interface addresses
|
||||
*
|
||||
* @zns: Zebra netlink socket
|
||||
* Return: Result status
|
||||
*/
|
||||
static int interface_addr_lookup_netlink(struct zebra_ns *zns)
|
||||
{
|
||||
int ret;
|
||||
struct zebra_dplane_info dp_info;
|
||||
struct nlsock *netlink_cmd = &zns->netlink_cmd;
|
||||
|
||||
/* Capture key info from ns struct */
|
||||
zebra_dplane_info_from_zns(&dp_info, zns, true /*is_cmd*/);
|
||||
|
||||
/* Get IPv4 address of the interfaces. */
|
||||
ret = netlink_request_intf_addr(netlink_cmd, AF_INET, RTM_GETADDR, 0);
|
||||
@ -1460,6 +1477,7 @@ int netlink_protodown(struct interface *ifp, bool down)
|
||||
void interface_list(struct zebra_ns *zns)
|
||||
{
|
||||
interface_lookup_netlink(zns);
|
||||
interface_addr_lookup_netlink(zns);
|
||||
}
|
||||
|
||||
#endif /* GNU_LINUX */
|
||||
|
Loading…
Reference in New Issue
Block a user