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.
This commit is contained in:
Miroslav Lichvar 2014-05-16 13:05:32 +02:00
parent b3b2f67d2f
commit 3de72917c3
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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;