summaryrefslogtreecommitdiff
path: root/ospfd/ospf_interface.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-09-19 09:40:57 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-09-19 13:34:06 -0400
commit3c3c325203848994bae83a85cb606d4e4deeeb25 (patch)
treeac8447eb389883d0f009599cb4ea460401f5af8b /ospfd/ospf_interface.c
parentb0b69e59f463b696d0e20f30c46c59c9cf0044b1 (diff)
*: Convert zapi->interface_delete to ifp callback
Convert the callback of the interface_delete to the new ifp callback. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospf_interface.c')
-rw-r--r--ospfd/ospf_interface.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 75d6211f8d..3407d1bad1 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -51,6 +51,7 @@ DEFINE_QOBJ_TYPE(ospf_interface)
DEFINE_HOOK(ospf_vl_add, (struct ospf_vl_data * vd), (vd))
DEFINE_HOOK(ospf_vl_delete, (struct ospf_vl_data * vd), (vd))
DEFINE_HOOK(ospf_if_update, (struct interface * ifp), (ifp))
+DEFINE_HOOK(ospf_if_delete, (struct interface * ifp), (ifp))
int ospf_interface_neighbor_count(struct ospf_interface *oi)
{
@@ -1323,6 +1324,21 @@ static int ospf_ifp_down(struct interface *ifp)
static int ospf_ifp_destroy(struct interface *ifp)
{
+ struct route_node *rn;
+
+ if (IS_DEBUG_OSPF(zebra, ZEBRA_INTERFACE))
+ zlog_debug(
+ "Zebra: interface delete %s vrf %s[%u] index %d flags %llx metric %d mtu %d",
+ ifp->name, ospf_vrf_id_to_name(ifp->vrf_id),
+ ifp->vrf_id, ifp->ifindex,
+ (unsigned long long)ifp->flags, ifp->metric, ifp->mtu);
+
+ hook_call(ospf_if_delete, ifp);
+
+ for (rn = route_top(IF_OIFS(ifp)); rn; rn = route_next(rn))
+ if (rn->info)
+ ospf_if_free((struct ospf_interface *)rn->info);
+
return 0;
}