--- ntp-4.0.99m-rc2/ntpdate/ntptime_config.c.usegethost Mon Mar 26 06:11:00 2001 +++ ntp-4.0.99m-rc2/ntpdate/ntptime_config.c Mon Jun 18 14:28:53 2001 @@ -23,6 +23,8 @@ #include #include #include +#include +#include /* * These routines are used to read the configuration file at @@ -151,10 +153,12 @@ int srvcnt; /* u_long peerkey; */ int peerflags; + struct hostent *hp; struct sockaddr_in peeraddr; FILE *fp; char line[MAXLINE]; char *(tokens[MAXTOKENS]); + char *host_string; int ntokens; int tok; const char *config_file; @@ -234,7 +238,12 @@ break; } - if (!getnetnum(tokens[1], &peeraddr, 1)) { + host_string = tokens[1]; + if ((hp = gethostbyname(tokens[1])) != NULL) { + host_string = inet_ntoa(*(struct in_addr *) hp->h_addr); + } + + if (!getnetnum(host_string, &peeraddr, 1)) { /* Resolve now, or lose! */ break; } else {