diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 04:24:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 04:24:31 +0000 |
commit | acb594b1d825c6e12369cebb941968ec08c840ce (patch) | |
tree | d544788908e7353a4f117e2991f15f4236a0c963 /zebra/irdp_main.c | |
parent | Adding upstream version 9.1. (diff) | |
download | frr-acb594b1d825c6e12369cebb941968ec08c840ce.tar.xz frr-acb594b1d825c6e12369cebb941968ec08c840ce.zip |
Adding upstream version 10.0.upstream/10.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'zebra/irdp_main.c')
-rw-r--r-- | zebra/irdp_main.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/zebra/irdp_main.c b/zebra/irdp_main.c index 6548790..349ae1a 100644 --- a/zebra/irdp_main.c +++ b/zebra/irdp_main.c @@ -197,7 +197,6 @@ void irdp_send_thread(struct event *t_advert) struct zebra_if *zi = ifp->info; struct irdp_interface *irdp = zi->irdp; struct prefix *p; - struct listnode *node, *nnode; struct connected *ifc; if (!irdp) @@ -205,16 +204,15 @@ void irdp_send_thread(struct event *t_advert) irdp->flags &= ~IF_SOLICIT; - if (ifp->connected) - for (ALL_LIST_ELEMENTS(ifp->connected, node, nnode, ifc)) { - p = ifc->address; + frr_each (if_connected, ifp->connected, ifc) { + p = ifc->address; - if (p->family != AF_INET) - continue; + if (p->family != AF_INET) + continue; - irdp_advertisement(ifp, p); - irdp->irdp_sent++; - } + irdp_advertisement(ifp, p); + irdp->irdp_sent++; + } tmp = irdp->MaxAdvertInterval - irdp->MinAdvertInterval; timer = frr_weak_random() % (tmp + 1); @@ -237,7 +235,6 @@ void irdp_advert_off(struct interface *ifp) { struct zebra_if *zi = ifp->info; struct irdp_interface *irdp = zi->irdp; - struct listnode *node, *nnode; int i; struct connected *ifc; struct prefix *p; @@ -247,19 +244,21 @@ void irdp_advert_off(struct interface *ifp) EVENT_OFF(irdp->t_advertise); - if (ifp->connected) - for (ALL_LIST_ELEMENTS(ifp->connected, node, nnode, ifc)) { - p = ifc->address; + frr_each (if_connected, ifp->connected, ifc) { + p = ifc->address; - /* Output some packets with Lifetime 0 - we should add a wait... - */ + if (p->family != AF_INET) + continue; - for (i = 0; i < IRDP_LAST_ADVERT_MESSAGES; i++) { - irdp->irdp_sent++; - irdp_advertisement(ifp, p); - } + /* Output some packets with Lifetime 0 + we should add a wait... + */ + + for (i = 0; i < IRDP_LAST_ADVERT_MESSAGES; i++) { + irdp->irdp_sent++; + irdp_advertisement(ifp, p); } + } } |