]> git.proxmox.com Git - mirror_frr.git/commitdiff
isisd: Convert signed to time_t for addition
authorDonald Sharp <sharpd@nvidia.com>
Wed, 13 Oct 2021 18:32:52 +0000 (14:32 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 13 Oct 2021 18:32:52 +0000 (14:32 -0400)
Convert a signed value to a time_t before addition
so that we can compare unsigned (time_t) to unsigned.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
isisd/isis_snmp.c

index c530eb9169061a6c7528b575be29dbe15f381a3e..1b78dc0be6a1a65e10cd4b339e6dd54bad098031 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 < (adj->last_upd + adj->hold_time))
+                       if (val < ((time_t)adj->last_upd + (time_t)adj->hold_time))
                                return SNMP_INTEGER(adj->last_upd
                                                    + adj->hold_time - val);
                }