From fce7f209fce60f0d8aff7af3df3e0a5434fc456f Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Thu, 19 Jan 2023 12:16:11 -0300 Subject: *: introduce function for sequence numbers Don't directly use `time()` for generating sequence numbers for two reasons: 1. `time()` can go backwards (due to NTP or time adjustments) 2. Coverity Scan warns every time we truncate a `time_t` variable for good reason (verify that we are Y2K38 ready). Found by Coverity Scan (CID 1519812, 1519786, 1519783 and 1519772) Signed-off-by: Rafael Zalamena --- eigrpd/eigrp_interface.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'eigrpd') diff --git a/eigrpd/eigrp_interface.c b/eigrpd/eigrp_interface.c index 28987b4af..891d28230 100644 --- a/eigrpd/eigrp_interface.c +++ b/eigrpd/eigrp_interface.c @@ -37,6 +37,7 @@ #include "if.h" #include "table.h" #include "memory.h" +#include "network.h" #include "command.h" #include "stream.h" #include "log.h" @@ -83,7 +84,7 @@ struct eigrp_interface *eigrp_if_new(struct eigrp *eigrp, struct interface *ifp, /* Initialize neighbor list. */ ei->nbrs = list_new(); - ei->crypt_seqnum = time(NULL); + ei->crypt_seqnum = frr_sequence32_next(); /* Initialize lists */ for (i = 0; i < EIGRP_FILTER_MAX; i++) { -- cgit v1.2.3