]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: use time_t for last update and last flap 9945/head
authorIgor Ryzhov <iryzhov@nfware.com>
Wed, 3 Nov 2021 09:40:40 +0000 (12:40 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Thu, 11 Nov 2021 11:58:35 +0000 (14:58 +0300)
These variables are only assigned with time() which returns time_t.
This should also fix occasional CI build failures because of comparisons
of signed and unsigned integers.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
isisd/isis_adjacency.c
isisd/isis_adjacency.h
isisd/isis_snmp.c

index ffda0f8643bc5932d8d12874ade83a61bac6ccc6..f5e8a790bfe64e1108b037f0c55369a12b52e951 100644 (file)
@@ -480,8 +480,7 @@ void isis_adj_print_vty(struct isis_adjacency *adj, struct vty *vty,
                vty_out(vty, "%-13s", adj_state2string(adj->adj_state));
                now = time(NULL);
                if (adj->last_upd) {
-                       if (adj->last_upd + adj->hold_time
-                           < (unsigned long long)now)
+                       if (adj->last_upd + adj->hold_time < now)
                                vty_out(vty, " Expiring");
                        else
                                vty_out(vty, " %-9llu",
@@ -508,8 +507,7 @@ void isis_adj_print_vty(struct isis_adjacency *adj, struct vty *vty,
                vty_out(vty, ", State: %s", adj_state2string(adj->adj_state));
                now = time(NULL);
                if (adj->last_upd) {
-                       if (adj->last_upd + adj->hold_time
-                           < (unsigned long long)now)
+                       if (adj->last_upd + adj->hold_time < now)
                                vty_out(vty, " Expiring");
                        else
                                vty_out(vty, ", Expires in %s",
index b7fab7ae1e893249163b5a314721bcdffb0f3b9d..4aa553e303c946413abd6f4f9f9d7d54db3fbd36 100644 (file)
@@ -96,8 +96,8 @@ struct isis_adjacency {
        int level;                      /* level (1 or 2) */
        enum isis_system_type sys_type; /* neighbourSystemType */
        uint16_t hold_time;             /* entryRemainingTime */
-       uint32_t last_upd;
-       uint32_t last_flap; /* last time the adj flapped */
+       time_t last_upd;
+       time_t last_flap; /* last time the adj flapped */
        enum isis_threeway_state threeway_state;
        uint32_t ext_circuit_id;
        int flaps;                    /* number of adjacency flaps  */
index 1b78dc0be6a1a65e10cd4b339e6dd54bad098031..c530eb9169061a6c7528b575be29dbe15f381a3e 100644 (file)
@@ -2571,7 +2571,7 @@ static uint8_t *isis_snmp_find_isadj(struct variable *v, oid *name,
                 */
                if (adj->last_upd != 0) {
                        val = time(NULL);
-                       if (val < ((time_t)adj->last_upd + (time_t)adj->hold_time))
+                       if (val < (adj->last_upd + adj->hold_time))
                                return SNMP_INTEGER(adj->last_upd
                                                    + adj->hold_time - val);
                }