--- ntp-4.0.99k/ntpdate/ntptime_config.c.usegethost Tue Feb 6 15:11:04 2001 +++ ntp-4.0.99k/ntpdate/ntptime_config.c Tue Feb 6 15:11:31 2001 @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include "ntp_fp.h" #include "ntp.h" @@ -156,10 +158,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; @@ -238,8 +242,13 @@ tokens[0]); 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 {