summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_neighbor.c
diff options
context:
space:
mode:
authorrgirada <rgirada@vmware.com>2020-08-21 19:03:05 +0200
committerrgirada <rgirada@vmware.com>2020-09-22 09:02:33 +0200
commit06bc3110d3845a40a6853609cef401304a6f1874 (patch)
tree3b840e25518eb7b88ce1673493b2dd681d9656b5 /ospfd/ospf_neighbor.c
parentospfd: ospf GR helper data structure definitions. (diff)
downloadfrr-06bc3110d3845a40a6853609cef401304a6f1874.tar.xz
frr-06bc3110d3845a40a6853609cef401304a6f1874.zip
ospfd: ospf GR helper initialization
Description: 1. Graceful restart helper init/de-init. 2. Defining dedicated memory for helper. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
Diffstat (limited to 'ospfd/ospf_neighbor.c')
-rw-r--r--ospfd/ospf_neighbor.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ospfd/ospf_neighbor.c b/ospfd/ospf_neighbor.c
index 46dfc505e..b0ff40afe 100644
--- a/ospfd/ospf_neighbor.c
+++ b/ospfd/ospf_neighbor.c
@@ -43,6 +43,7 @@
#include "ospfd/ospf_flood.h"
#include "ospfd/ospf_dump.h"
#include "ospfd/ospf_bfd.h"
+#include "ospfd/ospf_gr_helper.h"
/* Fill in the the 'key' as appropriate to retrieve the entry for nbr
* from the ospf_interface's nbrs table. Indexed by interface address
@@ -99,6 +100,14 @@ struct ospf_neighbor *ospf_nbr_new(struct ospf_interface *oi)
nbr->crypt_seqnum = 0;
ospf_bfd_info_nbr_create(oi, nbr);
+
+ /* Initialize GR Helper info*/
+ nbr->gr_helper_info.recvd_grace_period = 0;
+ nbr->gr_helper_info.actual_grace_period = 0;
+ nbr->gr_helper_info.gr_helper_status = OSPF_GR_NOT_HELPER;
+ nbr->gr_helper_info.helper_exit_reason = OSPF_GR_HELPER_EXIT_NONE;
+ nbr->gr_helper_info.gr_restart_reason = OSPF_GR_UNKNOWN_RESTART;
+
return nbr;
}
@@ -142,6 +151,8 @@ void ospf_nbr_free(struct ospf_neighbor *nbr)
ospf_bfd_info_free(&nbr->bfd_info);
+ OSPF_NSM_TIMER_OFF(nbr->gr_helper_info.t_grace_timer);
+
nbr->oi = NULL;
XFREE(MTYPE_OSPF_NEIGHBOR, nbr);
}