]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
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)
committerWilly Tarreau <w@1wt.eu>
Thu, 3 Apr 2025 09:26:21 +0000 (11:26 +0200)
This is has now impact currently since MS_TO_TICKS macro does nothing
but it will prevent further bugs.

src/peers.c

index f6001b1a3e3fab651a36e7df26591fae38aead0b..e4ac52b22aabca01fd1de2271a275ca8518ce633 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);