BUG/MINOR: peers: fix expire learned from a peer not converted from ms to ticks
authorEmeric Brun <ebrun@haproxy.com>
Thu, 3 Apr 2025 08:29:16 +0000 (10:29 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Thu, 3 Apr 2025 17:19:41 +0000 (19:19 +0200)
This is has now impact currently since MS_TO_TICKS macro does nothing
but it will prevent further bugs.

(cherry picked from commit 00461fbfbfd19e93af621658abcf7d1205f44182)
Signed-off-by: Aurelien DARRAGON <adarragon@haproxy.com>

src/peers.c

index c17e6ec..e9a54cc 100644 (file)
@@ -1740,6 +1740,8 @@ static int peer_treat_updatemsg(struct appctx *appctx, struct peer *p, int updt,
                memcpy(&expire, *msg_cur, expire_sz);
                *msg_cur += expire_sz;
                expire = ntohl(expire);
+               /* the rest of the code considers expire as ticks and not MS */
+               expire = MS_TO_TICKS(expire);
        }
 
        newts = stksess_new(table, NULL);