diff options
| author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2023-01-19 12:16:11 -0300 |
|---|---|---|
| committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2023-01-20 15:40:28 -0300 |
| commit | fce7f209fce60f0d8aff7af3df3e0a5434fc456f (patch) | |
| tree | 5eeb8b5b75b964ddbd3a76379c6c98c6cd5cf560 /ospfd/ospf_interface.c | |
| parent | b6ee94b5b1f0a0652455264fa62a92ed5abbf855 (diff) | |
*: 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 'ospfd/ospf_interface.c')
| -rw-r--r-- | ospfd/ospf_interface.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c index a0b14e73ee..831906b908 100644 --- a/ospfd/ospf_interface.c +++ b/ospfd/ospf_interface.c @@ -30,6 +30,7 @@ #include "command.h" #include "stream.h" #include "log.h" +#include "network.h" #include "zclient.h" #include "bfd.h" #include "ldp_sync.h" @@ -274,7 +275,7 @@ struct ospf_interface *ospf_if_new(struct ospf *ospf, struct interface *ifp, oi->t_ls_upd_event = NULL; oi->t_ls_ack_direct = NULL; - oi->crypt_seqnum = time(NULL); + oi->crypt_seqnum = frr_sequence32_next(); ospf_opaque_type9_lsa_init(oi); |
