summaryrefslogtreecommitdiff
path: root/ospfd/ospf_nsm.c
diff options
context:
space:
mode:
authorrgirada <rgirada@vmware.com>2020-08-22 05:08:01 -0700
committerrgirada <rgirada@vmware.com>2020-09-22 00:02:37 -0700
commit5a77dd8feb62c42178cce9aea29e29ff49acc87c (patch)
tree4c86de97f1d3297750e1c4cb054b4c3eb317a5b1 /ospfd/ospf_nsm.c
parentad6869921751c4c33874db2ecf7164aacb8662df (diff)
ospfd: GR Helper functionality changes
Description: 1. Skipping inactivity timer during graceful restart to make the RESTARTER active even after dead timer expiry. 2. Handling HELPER on unplanned outages. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
Diffstat (limited to 'ospfd/ospf_nsm.c')
-rw-r--r--ospfd/ospf_nsm.c40
1 files changed, 29 insertions, 11 deletions
diff --git a/ospfd/ospf_nsm.c b/ospfd/ospf_nsm.c
index 03277ae61c..2931831826 100644
--- a/ospfd/ospf_nsm.c
+++ b/ospfd/ospf_nsm.c
@@ -70,7 +70,15 @@ static int ospf_inactivity_timer(struct thread *thread)
IF_NAME(nbr->oi), inet_ntoa(nbr->router_id),
ospf_get_name(nbr->oi->ospf));
- OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_InactivityTimer);
+ /* Dont trigger NSM_InactivityTimer event , if the current
+ * router acting as HELPER for this neighbour.
+ */
+ if (!OSPF_GR_IS_ACTIVE_HELPER(nbr))
+ OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_InactivityTimer);
+ else if (IS_DEBUG_OSPF_GR_HELPER)
+ zlog_debug(
+ "%s, Acting as HELPER for this neighbour, So inactivitytimer event will not be fired.",
+ __PRETTY_FUNCTION__);
return 0;
}
@@ -689,7 +697,11 @@ static void nsm_change_state(struct ospf_neighbor *nbr, int state)
lookup_msg(ospf_nsm_state_msg, old_state, NULL),
lookup_msg(ospf_nsm_state_msg, state, NULL));
- ospf_router_lsa_update_area(oi->area);
+ /* Dont originate router LSA if the current
+ * router is acting as a HELPER for this neighbour.
+ */
+ if (!OSPF_GR_IS_ACTIVE_HELPER(nbr))
+ ospf_router_lsa_update_area(oi->area);
if (oi->type == OSPF_IFTYPE_VIRTUALLINK) {
vl_area = ospf_area_lookup_by_area_id(
@@ -699,15 +711,21 @@ static void nsm_change_state(struct ospf_neighbor *nbr, int state)
ospf_router_lsa_update_area(vl_area);
}
- /* Originate network-LSA. */
- if (oi->state == ISM_DR) {
- if (oi->network_lsa_self && oi->full_nbrs == 0) {
- ospf_lsa_flush_area(oi->network_lsa_self,
- oi->area);
- ospf_lsa_unlock(&oi->network_lsa_self);
- oi->network_lsa_self = NULL;
- } else
- ospf_network_lsa_update(oi);
+ /* Dont originate/flush network LSA if the current
+ * router is acting as a HELPER for this neighbour.
+ */
+ if (!OSPF_GR_IS_ACTIVE_HELPER(nbr)) {
+ /* Originate network-LSA. */
+ if (oi->state == ISM_DR) {
+ if (oi->network_lsa_self
+ && oi->full_nbrs == 0) {
+ ospf_lsa_flush_area(
+ oi->network_lsa_self, oi->area);
+ ospf_lsa_unlock(&oi->network_lsa_self);
+ oi->network_lsa_self = NULL;
+ } else
+ ospf_network_lsa_update(oi);
+ }
}
}