mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-30 01:16:39 +00:00
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>
This commit is contained in:
parent
ad68699217
commit
5a77dd8feb
@ -70,7 +70,15 @@ static int ospf_inactivity_timer(struct thread *thread)
|
|||||||
IF_NAME(nbr->oi), inet_ntoa(nbr->router_id),
|
IF_NAME(nbr->oi), inet_ntoa(nbr->router_id),
|
||||||
ospf_get_name(nbr->oi->ospf));
|
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;
|
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, old_state, NULL),
|
||||||
lookup_msg(ospf_nsm_state_msg, 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) {
|
if (oi->type == OSPF_IFTYPE_VIRTUALLINK) {
|
||||||
vl_area = ospf_area_lookup_by_area_id(
|
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);
|
ospf_router_lsa_update_area(vl_area);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Originate network-LSA. */
|
/* Dont originate/flush network LSA if the current
|
||||||
if (oi->state == ISM_DR) {
|
* router is acting as a HELPER for this neighbour.
|
||||||
if (oi->network_lsa_self && oi->full_nbrs == 0) {
|
*/
|
||||||
ospf_lsa_flush_area(oi->network_lsa_self,
|
if (!OSPF_GR_IS_ACTIVE_HELPER(nbr)) {
|
||||||
oi->area);
|
/* Originate network-LSA. */
|
||||||
ospf_lsa_unlock(&oi->network_lsa_self);
|
if (oi->state == ISM_DR) {
|
||||||
oi->network_lsa_self = NULL;
|
if (oi->network_lsa_self
|
||||||
} else
|
&& oi->full_nbrs == 0) {
|
||||||
ospf_network_lsa_update(oi);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
#include "ospfd/ospf_dump.h"
|
#include "ospfd/ospf_dump.h"
|
||||||
#include "ospfd/ospf_errors.h"
|
#include "ospfd/ospf_errors.h"
|
||||||
#include "ospfd/ospf_zebra.h"
|
#include "ospfd/ospf_zebra.h"
|
||||||
|
#include "ospfd/ospf_gr_helper.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* OSPF Fragmentation / fragmented writes
|
* OSPF Fragmentation / fragmented writes
|
||||||
@ -1058,7 +1059,16 @@ static void ospf_hello(struct ip *iph, struct ospf_header *ospfh,
|
|||||||
OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_TwoWayReceived);
|
OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_TwoWayReceived);
|
||||||
nbr->options |= hello->options;
|
nbr->options |= hello->options;
|
||||||
} else {
|
} else {
|
||||||
OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_OneWayReceived);
|
/* If the router is DR_OTHER, RESTARTER will not wait
|
||||||
|
* until it receives the hello from it if it receives
|
||||||
|
* from DR and BDR.
|
||||||
|
* So, helper might receives ONW_WAY hello from
|
||||||
|
* RESTARTER. So not allowing to change the state if it
|
||||||
|
* receives one_way hellow when it acts as HELPER for
|
||||||
|
* that specific neighbor.
|
||||||
|
*/
|
||||||
|
if (!OSPF_GR_IS_ACTIVE_HELPER(nbr))
|
||||||
|
OSPF_NSM_EVENT_SCHEDULE(nbr, NSM_OneWayReceived);
|
||||||
/* Set neighbor information. */
|
/* Set neighbor information. */
|
||||||
nbr->priority = hello->priority;
|
nbr->priority = hello->priority;
|
||||||
nbr->d_router = hello->d_router;
|
nbr->d_router = hello->d_router;
|
||||||
@ -4262,6 +4272,12 @@ void ospf_ls_ack_send(struct ospf_neighbor *nbr, struct ospf_lsa *lsa)
|
|||||||
{
|
{
|
||||||
struct ospf_interface *oi = nbr->oi;
|
struct ospf_interface *oi = nbr->oi;
|
||||||
|
|
||||||
|
if (IS_GRACE_LSA(lsa)) {
|
||||||
|
if (IS_DEBUG_OSPF_GR_HELPER)
|
||||||
|
zlog_debug("%s, Sending GRACE ACK to Restarter.",
|
||||||
|
__PRETTY_FUNCTION__);
|
||||||
|
}
|
||||||
|
|
||||||
if (listcount(oi->ls_ack_direct.ls_ack) == 0)
|
if (listcount(oi->ls_ack_direct.ls_ack) == 0)
|
||||||
oi->ls_ack_direct.dst = nbr->address.u.prefix4;
|
oi->ls_ack_direct.dst = nbr->address.u.prefix4;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user