summaryrefslogtreecommitdiff
path: root/ldpd/ldp_zebra.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-09-18 23:07:44 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-09-19 13:34:06 -0400
commitddbf3e60604019d4b38d51226700e2244cc531b6 (patch)
treed3403922091432832dfffe8b86e8c6610691e177 /ldpd/ldp_zebra.c
parentef7bd2a3d5ecab37018f4035391f99c25ddadeab (diff)
*: Convert from ->interface_up to the interface callback
For all the places we have a zclient->interface_up convert them to use the interface ifp_up callback instead. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'ldpd/ldp_zebra.c')
-rw-r--r--ldpd/ldp_zebra.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/ldpd/ldp_zebra.c b/ldpd/ldp_zebra.c
index d24079f41a..d3eac60173 100644
--- a/ldpd/ldp_zebra.c
+++ b/ldpd/ldp_zebra.c
@@ -301,22 +301,13 @@ ldp_interface_delete(ZAPI_CALLBACK_ARGS)
}
static int
-ldp_interface_status_change(ZAPI_CALLBACK_ARGS)
+ldp_interface_status_change_helper(struct interface *ifp)
{
- struct interface *ifp;
struct listnode *node;
struct connected *ifc;
struct kif kif;
struct kaddr ka;
- /*
- * zebra_interface_state_read() updates interface structure in
- * iflist.
- */
- ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
- if (ifp == NULL)
- return (0);
-
debug_zebra_in("interface %s state update", ifp->name);
ifp2kif(ifp, &kif);
@@ -338,6 +329,21 @@ ldp_interface_status_change(ZAPI_CALLBACK_ARGS)
return (0);
}
+static int
+ldp_interface_status_change(ZAPI_CALLBACK_ARGS)
+{
+ struct interface *ifp;
+
+ /*
+ * zebra_interface_state_read() updates interface structure in
+ * iflist.
+ */
+ ifp = zebra_interface_state_read(zclient->ibuf, vrf_id);
+ if (ifp == NULL)
+ return (0);
+
+ return ldp_interface_status_change_helper(ifp);
+}
static int
ldp_interface_address_add(ZAPI_CALLBACK_ARGS)
@@ -531,7 +537,7 @@ extern struct zebra_privs_t ldpd_privs;
static int ldp_ifp_up(struct interface *ifp)
{
- return 0;
+ return ldp_interface_status_change_helper(ifp);
}
static int ldp_ifp_down(struct interface *ifp)
@@ -558,7 +564,6 @@ ldp_zebra_init(struct thread_master *master)
zclient->zebra_connected = ldp_zebra_connected;
zclient->router_id_update = ldp_router_id_update;
zclient->interface_delete = ldp_interface_delete;
- zclient->interface_up = ldp_interface_status_change;
zclient->interface_down = ldp_interface_status_change;
zclient->interface_address_add = ldp_interface_address_add;
zclient->interface_address_delete = ldp_interface_address_delete;