]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd, ospf6d: fix time_t truncation
authorRenato Westphal <renato@opensourcerouting.org>
Tue, 30 May 2023 22:41:39 +0000 (19:41 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Tue, 30 May 2023 22:47:28 +0000 (19:47 -0300)
Change timestamp parameter from int to time_t to avoid truncation.

Found by Coverity Scan (CID 1563226 and 1563222)

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ospf6d/ospf6_gr.c
ospf6d/ospf6_gr.h
ospfd/ospf_gr.c
ospfd/ospf_gr.h

index 3d5d4d259f47e4f39d9583e78a92191f4594b9c2..ecaaa038ab5d4dac14e19af718092e44a50e66f0 100644 (file)
@@ -239,7 +239,8 @@ static void ospf6_gr_restart_exit(struct ospf6 *ospf6, const char *reason)
 
 /* Enter the Graceful Restart mode. */
 void ospf6_gr_restart_enter(struct ospf6 *ospf6,
-                           enum ospf6_gr_restart_reason reason, int timestamp)
+                           enum ospf6_gr_restart_reason reason,
+                           time_t timestamp)
 {
        unsigned long remaining_time;
 
index e6566a609872de63bb6dbd92321e40c0cbecb851..84ef3aeb8acd4bc03599ec3f5db757cf62bf1408 100644 (file)
@@ -158,7 +158,7 @@ extern int config_write_ospf6_debug_gr_helper(struct vty *vty);
 extern void ospf6_gr_iface_send_grace_lsa(struct event *thread);
 extern void ospf6_gr_restart_enter(struct ospf6 *ospf6,
                                   enum ospf6_gr_restart_reason reason,
-                                  int timestamp);
+                                  time_t timestamp);
 extern void ospf6_gr_check_lsdb_consistency(struct ospf6 *ospf,
                                            struct ospf6_area *area);
 extern void ospf6_gr_nvm_read(struct ospf6 *ospf);
index 6999b3f623a6584ddcd38d18984d8502e6b3c9e9..2a346f2388c1f2d45955c61cf1f1cfb8594da4f6 100644 (file)
@@ -282,7 +282,7 @@ static void ospf_gr_restart_exit(struct ospf *ospf, const char *reason)
 
 /* Enter the Graceful Restart mode. */
 void ospf_gr_restart_enter(struct ospf *ospf,
-                          enum ospf_gr_restart_reason reason, int timestamp)
+                          enum ospf_gr_restart_reason reason, time_t timestamp)
 {
        unsigned long remaining_time;
 
index 750d77381d85b1f14dc6072fc0a9a5b23ff05f08..22f9e1ef22533c04da39d6efd0e1145cd988d808 100644 (file)
@@ -169,7 +169,7 @@ extern void ospf_gr_helper_set_supported_planned_only_restart(struct ospf *ospf,
 extern void ospf_gr_iface_send_grace_lsa(struct event *thread);
 extern void ospf_gr_restart_enter(struct ospf *ospf,
                                  enum ospf_gr_restart_reason reason,
-                                 int timestamp);
+                                 time_t timestamp);
 extern void ospf_gr_check_lsdb_consistency(struct ospf *ospf,
                                                  struct ospf_area *area);
 extern void ospf_gr_check_adjs(struct ospf *ospf);