Skip to content

Commit

Permalink
Check if the variable next_value->ping_ts != 0 in seqmap_add()
Browse files Browse the repository at this point in the history
  • Loading branch information
gsnw authored and schweikert committed Apr 8, 2024
1 parent c3a2f2c commit 94e98ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/seqmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ unsigned int seqmap_add(unsigned int host_nr, unsigned int ping_count, int64_t t
/* check if expired (note that unused seqmap values will have fields set to
* 0, so will be seen as expired */
next_value = &seqmap_map[seqmap_next_id];
if (timestamp - next_value->ping_ts < SEQMAP_TIMEOUT_IN_NS) {
if (next_value->ping_ts != 0 && timestamp - next_value->ping_ts < SEQMAP_TIMEOUT_IN_NS) {
fprintf(stderr, "fping error: not enough sequence numbers available! (expire_timeout=%" PRId64 ", host_nr=%d, ping_count=%d, seqmap_next_id=%d)\n",
SEQMAP_TIMEOUT_IN_NS, host_nr, ping_count, seqmap_next_id);
exit(4);
Expand Down

0 comments on commit 94e98ac

Please sign in to comment.