summaryrefslogtreecommitdiff
path: root/ospfd/ospf_interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospfd/ospf_interface.c')
-rw-r--r--ospfd/ospf_interface.c61
1 files changed, 44 insertions, 17 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 6bfdb1e9e0..6e34740166 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -796,9 +796,36 @@ int ospf_if_up(struct ospf_interface *oi)
int ospf_if_down(struct ospf_interface *oi)
{
+ struct ospf *ospf;
+
if (oi == NULL)
return 0;
+ ospf = oi->ospf;
+
+ /* Cease the HELPER role for all the neighbours
+ * of this interface.
+ */
+ if (ospf->is_helper_supported) {
+ struct route_node *rn = NULL;
+
+ if (ospf_interface_neighbor_count(oi)) {
+ for (rn = route_top(oi->nbrs); rn;
+ rn = route_next(rn)) {
+ struct ospf_neighbor *nbr = NULL;
+
+ if (!rn->info)
+ continue;
+
+ nbr = rn->info;
+
+ if (OSPF_GR_IS_ACTIVE_HELPER(nbr))
+ ospf_gr_helper_exit(
+ nbr, OSPF_GR_HELPER_TOPO_CHG);
+ }
+ }
+ }
+
OSPF_ISM_EVENT_EXECUTE(oi, ISM_InterfaceDown);
/* delete position in router LSA */
oi->lsa_pos_beg = 0;
@@ -950,17 +977,17 @@ struct ospf_vl_data *ospf_vl_lookup(struct ospf *ospf, struct ospf_area *area,
struct listnode *node;
if (IS_DEBUG_OSPF_EVENT) {
- zlog_debug("%s: Looking for %s", __func__, inet_ntoa(vl_peer));
+ zlog_debug("%s: Looking for %pI4", __func__, &vl_peer);
if (area)
- zlog_debug("%s: in area %s", __func__,
- inet_ntoa(area->area_id));
+ zlog_debug("%s: in area %pI4", __func__,
+ &area->area_id);
}
for (ALL_LIST_ELEMENTS_RO(ospf->vlinks, node, vl_data)) {
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug("%s: VL %s, peer %s", __func__,
+ zlog_debug("%s: VL %s, peer %pI4", __func__,
vl_data->vl_oi->ifp->name,
- inet_ntoa(vl_data->vl_peer));
+ &vl_data->vl_peer);
if (area
&& !IPV4_ADDR_SAME(&vl_data->vl_area_id, &area->area_id))
@@ -1082,9 +1109,9 @@ static int ospf_vl_set_params(struct ospf_area *area,
}
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug("%s: %s peer address: %s, cost: %d,%schanged",
+ zlog_debug("%s: %s peer address: %pI4, cost: %d,%schanged",
__func__, vl_data->vl_oi->ifp->name,
- inet_ntoa(vl_data->peer_addr), voi->output_cost,
+ &vl_data->peer_addr, voi->output_cost,
(changed ? " " : " un"));
return changed;
@@ -1101,19 +1128,19 @@ void ospf_vl_up_check(struct ospf_area *area, struct in_addr rid,
if (IS_DEBUG_OSPF_EVENT) {
zlog_debug("ospf_vl_up_check(): Start");
- zlog_debug("ospf_vl_up_check(): Router ID is %s",
- inet_ntoa(rid));
- zlog_debug("ospf_vl_up_check(): Area is %s",
- inet_ntoa(area->area_id));
+ zlog_debug("ospf_vl_up_check(): Router ID is %pI4",
+ &rid);
+ zlog_debug("ospf_vl_up_check(): Area is %pI4",
+ &area->area_id);
}
for (ALL_LIST_ELEMENTS_RO(ospf->vlinks, node, vl_data)) {
if (IS_DEBUG_OSPF_EVENT) {
- zlog_debug("%s: considering VL, %s in area %s",
+ zlog_debug("%s: considering VL, %s in area %pI4",
__func__, vl_data->vl_oi->ifp->name,
- inet_ntoa(vl_data->vl_area_id));
- zlog_debug("%s: peer ID: %s", __func__,
- inet_ntoa(vl_data->vl_peer));
+ &vl_data->vl_area_id);
+ zlog_debug("%s: peer ID: %pI4", __func__,
+ &vl_data->vl_peer);
}
if (IPV4_ADDR_SAME(&vl_data->vl_peer, &rid)
@@ -1171,8 +1198,8 @@ int ospf_full_virtual_nbrs(struct ospf_area *area)
{
if (IS_DEBUG_OSPF_EVENT) {
zlog_debug(
- "counting fully adjacent virtual neighbors in area %s",
- inet_ntoa(area->area_id));
+ "counting fully adjacent virtual neighbors in area %pI4",
+ &area->area_id);
zlog_debug("there are %d of them", area->full_vls);
}