char *arguments[MAXARGS];
register struct hostent *hp;
register struct servent *sp;
-/* we assume netent and getnetbyaddr come with gethostbyname */
-#ifdef HAVE_GETHOSTBYNAME
+#ifndef HAVE_GETHOSTBYNAME
register struct netent *np;
#endif
#ifdef KPOP
int rem;
+ struct hostent *hp2;
#endif /* KPOP */
for (ap = nets; ap < n1; ap++)
if (kservice) { /* "pop" */
char *instance;
- if ((instance = strdup (hp->h_name)) == NULL) {
+ if (( hp2 = gethostbyaddr( hp->h_addr, hp->h_length, hp->h_addrtype ))
+ == NULL ) {
+ return NOTOK;
+ }
+ if ((instance = strdup (hp2->h_name)) == NULL) {
close (sd);
strncpy (response, "Out of memory.", len_response);
return OOPS2;