summaryrefslogtreecommitdiff
path: root/ospfd
diff options
context:
space:
mode:
authorJafar Al-Gharaibeh <jafar@atcorp.com>2024-11-05 13:30:24 -0600
committerGitHub <noreply@github.com>2024-11-05 13:30:24 -0600
commit905fc5c61126f0a16efc679ad9b56ff33123f466 (patch)
tree0c9fd0cf48a293c285810351ca5a19cfd4b27949 /ospfd
parentfe20f83286e103ba12f9cc83c7f30dec47c6d31c (diff)
parent64c67c1ce090085501d56b3b9a0aa2100d82c8ec (diff)
Merge pull request #17346 from LabNConsulting/aceelindem/fix_ospf_refresh_interval_assert
ospfd: Fix assert in LSA refresh interval setting
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_lsa.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index f175bbf9e4..1350487898 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -106,7 +106,7 @@ int tv2msec(struct timeval tv)
int msecs;
msecs = tv.tv_sec * 1000;
- msecs += tv.tv_usec / 1000;
+ msecs += (tv.tv_usec + 1000) / 1000;
return msecs;
}
@@ -126,7 +126,12 @@ int ospf_lsa_refresh_delay(struct ospf *ospf, struct ospf_lsa *lsa)
zlog_debug("LSA[Type%d:%pI4]: Refresh timer delay %d milliseconds",
lsa->data->type, &lsa->data->id, delay);
- assert(delay > 0);
+ if (delay <= 0) {
+ zlog_warn("LSA[Type%d:%pI4]: Invalid refresh timer delay %d milliseconds Seq: 0x%x Age:%u",
+ lsa->data->type, &lsa->data->id, delay,
+ ntohl(lsa->data->ls_seqnum), ntohs(lsa->data->ls_age));
+ delay = 0;
+ }
}
return delay;