diff options
author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2023-01-19 16:16:11 +0100 |
---|---|---|
committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2023-01-20 19:40:28 +0100 |
commit | fce7f209fce60f0d8aff7af3df3e0a5434fc456f (patch) | |
tree | 5eeb8b5b75b964ddbd3a76379c6c98c6cd5cf560 /eigrpd | |
parent | ldpd: fix time truncation (diff) | |
download | frr-fce7f209fce60f0d8aff7af3df3e0a5434fc456f.tar.xz frr-fce7f209fce60f0d8aff7af3df3e0a5434fc456f.zip |
*: 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 <rzalamena@opensourcerouting.org>
Diffstat (limited to 'eigrpd')
-rw-r--r-- | eigrpd/eigrp_interface.c | 3 |
1 files changed, 2 insertions, 1 deletions
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++) { |