diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2023-11-23 17:45:07 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-23 17:45:07 -0500 |
| commit | 25f1b66fde6bee4051d57bf54202f83388ae4b57 (patch) | |
| tree | be471f8e0ab35f0e6cc86a7d43810745daeb9865 /zebra/irdp_interface.c | |
| parent | 27be058232ad530e2446cb8a12de0a7d04d0a758 (diff) | |
| parent | 6e7465c54e6be65ec88f88b4493fd073698cb39d (diff) | |
Merge pull request #14863 from opensourcerouting/if-connected-dlist
*: convert struct interface->connected to DLIST
Diffstat (limited to 'zebra/irdp_interface.c')
| -rw-r--r-- | zebra/irdp_interface.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/zebra/irdp_interface.c b/zebra/irdp_interface.c index 253e6a8dd6..591236d680 100644 --- a/zebra/irdp_interface.c +++ b/zebra/irdp_interface.c @@ -87,12 +87,12 @@ static const char *inet_2a(uint32_t a, char *b, size_t b_len) static struct prefix *irdp_get_prefix(struct interface *ifp) { - struct listnode *node; struct connected *ifc; - if (ifp->connected) - for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, ifc)) + frr_each (if_connected, ifp->connected, ifc) { + if (ifc->address->family == AF_INET) return ifc->address; + } return NULL; } @@ -198,7 +198,6 @@ static void irdp_if_start(struct interface *ifp, int multicast, { struct zebra_if *zi = ifp->info; struct irdp_interface *irdp = zi->irdp; - struct listnode *node; struct connected *ifc; uint32_t timer, seed; @@ -247,11 +246,12 @@ static void irdp_if_start(struct interface *ifp, int multicast, /* The spec suggests this for randomness */ seed = 0; - if (ifp->connected) - for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, ifc)) { + frr_each (if_connected, ifp->connected, ifc) { + if (ifc->address->family == AF_INET) { seed = ifc->address->u.prefix4.s_addr; break; } + } srandom(seed); timer = (frr_weak_random() % IRDP_DEFAULT_INTERVAL) + 1; |
