summaryrefslogtreecommitdiffstats
path: root/ldpd/ldp_zebra.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldpd/ldp_zebra.c')
-rw-r--r--ldpd/ldp_zebra.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/ldpd/ldp_zebra.c b/ldpd/ldp_zebra.c
index 0fd5d46..df682a1 100644
--- a/ldpd/ldp_zebra.c
+++ b/ldpd/ldp_zebra.c
@@ -330,7 +330,6 @@ void
kif_redistribute(const char *ifname)
{
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
- struct listnode *cnode;
struct interface *ifp;
struct connected *ifc;
struct kif kif;
@@ -343,7 +342,7 @@ kif_redistribute(const char *ifname)
ifp2kif(ifp, &kif);
main_imsg_compose_both(IMSG_IFSTATUS, &kif, sizeof(kif));
- for (ALL_LIST_ELEMENTS_RO(ifp->connected, cnode, ifc)) {
+ frr_each (if_connected, ifp->connected, ifc) {
ifc2kaddr(ifp, ifc, &ka);
main_imsg_compose_ldpe(IMSG_NEWADDR, 0, &ka, sizeof(ka));
}
@@ -400,7 +399,6 @@ ldp_ifp_destroy(struct interface *ifp)
static int
ldp_interface_status_change(struct interface *ifp)
{
- struct listnode *node;
struct connected *ifc;
struct kif kif;
struct kaddr ka;
@@ -411,12 +409,12 @@ ldp_interface_status_change(struct interface *ifp)
main_imsg_compose_both(IMSG_IFSTATUS, &kif, sizeof(kif));
if (if_is_operative(ifp)) {
- for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, ifc)) {
+ frr_each (if_connected, ifp->connected, ifc) {
ifc2kaddr(ifp, ifc, &ka);
main_imsg_compose_ldpe(IMSG_NEWADDR, 0, &ka, sizeof(ka));
}
} else {
- for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, ifc)) {
+ frr_each (if_connected, ifp->connected, ifc) {
ifc2kaddr(ifp, ifc, &ka);
main_imsg_compose_ldpe(IMSG_DELADDR, 0, &ka, sizeof(ka));
}
@@ -682,7 +680,10 @@ static zclient_handler *const ldp_handlers[] = {
void ldp_zebra_init(struct event_loop *master)
{
- if_zapi_callbacks(ldp_ifp_create, ldp_ifp_up, ldp_ifp_down, ldp_ifp_destroy);
+ hook_register_prio(if_real, 0, ldp_ifp_create);
+ hook_register_prio(if_up, 0, ldp_ifp_up);
+ hook_register_prio(if_down, 0, ldp_ifp_down);
+ hook_register_prio(if_unreal, 0, ldp_ifp_destroy);
/* Set default values. */
zclient = zclient_new(master, &zclient_options_default, ldp_handlers,