From 3de72917c3d458bec38b3dda11eda873ad5c3fda Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Fri, 16 May 2014 13:05:32 +0200 Subject: [PATCH] client: set default hostname to 127.0.0.1 instead of localhost This is to make sure chronyd will see the remote address as 127.0.0.1 and allow access even when localhost resolves to an address of a non-loopback interface. --- chronyc.1.in | 2 +- client.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chronyc.1.in b/chronyc.1.in index 09d044a..a7c91c7 100644 --- a/chronyc.1.in +++ b/chronyc.1.in @@ -24,7 +24,7 @@ A summary of the options supported by \fBchronyc\fR is included below. .TP \fB\-h\fR \fIhostname\fR -specify hostname +specify hostname (default 127.0.0.1) .TP \fB\-p\fR \fIport-number\fR specify port-number diff --git a/client.c b/client.c index 37a0c50..afae699 100644 --- a/client.c +++ b/client.c @@ -2729,7 +2729,7 @@ main(int argc, char **argv) { char *line; const char *progname = argv[0]; - const char *hostname = "localhost"; + const char *hostname = "127.0.0.1"; const char *conf_file = DEFAULT_CONF_FILE; int quit = 0, ret = 1, multi = 0, auto_auth = 0, short_timeout = 1; int port = DEFAULT_CANDM_PORT;