From: Miroslav Lichvar Date: Wed, 26 Jan 2022 15:00:36 +0000 (+0100) Subject: client: fix waitsync command to reconnect to server X-Git-Tag: 4.3-pre1~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=759580aa6f32fcc591ff357c12b54c22a8e03b91;p=thirdparty%2Fchrony.git client: fix waitsync command to reconnect to server If chronyc waitsync was started before chronyd, it would try all addresses (Unix socket, IPv4, IPv6) and get stuck with no address, not getting any response later when chronyd was running. Reset the address index in open_io() when returning with failure to allow the next call to start with the first address again. Reported-by: Jan Mikkelsen --- diff --git a/client.c b/client.c index ed551c6d..f878fd1c 100644 --- a/client.c +++ b/client.c @@ -283,6 +283,9 @@ open_io(void) close_io(); } + /* Start from the first address if called again */ + address_index = 0; + return 0; }