Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ospfd: Fix assert in LSA refresh interval setting #17346

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions ospfd/ospf_lsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down
Loading