summaryrefslogtreecommitdiff
path: root/ospfd/ospf_interface.c
diff options
context:
space:
mode:
authorrgirada <rgirada@vmware.com>2021-07-20 03:24:56 -0700
committerrgirada <rgirada@vmware.com>2021-07-22 10:22:07 -0700
commitbe418160a7695ae2b003ec0e42418d8cbd29bb84 (patch)
treefbf7d4a2acfa136aeaa8f6b2b098d242d5a7a5ac /ospfd/ospf_interface.c
parent1dce93dabb078a02cf11c229fa67881fa101d463 (diff)
ospfd: OSPF hello packets not sent with configured hello timer
Description : ospf hello timer is not getting refelcted upon changing the hello interval. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
Diffstat (limited to 'ospfd/ospf_interface.c')
-rw-r--r--ospfd/ospf_interface.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 029f929c11..e0e61a2664 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -1447,6 +1447,58 @@ static int ospf_ifp_destroy(struct interface *ifp)
return 0;
}
+/* Resetting ospf hello timer */
+void ospf_reset_hello_timer(struct interface *ifp, struct in_addr addr,
+ bool is_addr)
+{
+ struct route_node *rn;
+
+ if (is_addr) {
+ struct prefix p;
+ struct ospf_interface *oi = NULL;
+
+ p.u.prefix4 = addr;
+ p.family = AF_INET;
+
+ oi = ospf_if_table_lookup(ifp, &p);
+
+ if (oi) {
+ /* Send hello before restart the hello timer
+ * to avoid session flaps in case of bigger
+ * hello interval configurations.
+ */
+ ospf_hello_send(oi);
+
+ /* Restart hello timer for this interface */
+ OSPF_ISM_TIMER_OFF(oi->t_hello);
+ OSPF_HELLO_TIMER_ON(oi);
+ }
+
+ return;
+ }
+
+ for (rn = route_top(IF_OIFS(ifp)); rn; rn = route_next(rn)) {
+ struct ospf_interface *oi = rn->info;
+
+ if (!oi)
+ continue;
+
+ /* If hello interval configured on this oi, don't restart. */
+ if (OSPF_IF_PARAM_CONFIGURED(oi->params, v_hello))
+ continue;
+
+ /* Send hello before restart the hello timer
+ * to avoid session flaps in case of bigger
+ * hello interval configurations.
+ */
+ ospf_hello_send(oi);
+
+ /* Restart the hello timer. */
+ OSPF_ISM_TIMER_OFF(oi->t_hello);
+ OSPF_HELLO_TIMER_ON(oi);
+ }
+}
+
void ospf_if_init(void)
{
if_zapi_callbacks(ospf_ifp_create, ospf_ifp_up,