From 94e98acaaa1b9f2fb3e648842f6e5a1a3b67101e Mon Sep 17 00:00:00 2001 From: German Service Network Date: Wed, 20 Mar 2024 07:31:37 +0100 Subject: [PATCH] Check if the variable next_value->ping_ts != 0 in seqmap_add() --- src/seqmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/seqmap.c b/src/seqmap.c index 4a4e38a..62506d0 100644 --- a/src/seqmap.c +++ b/src/seqmap.c @@ -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); -- 2.43.0