1 --- netkit-telnet-0.17.orig/telnetd/telnetd.c 2007-03-13 16:31:20.000000000 +0000
2 +++ netkit-telnet-0.17.orig/telnetd/telnetd.c 2007-03-13 16:31:26.000000000 +0000
3 @@ -653,6 +653,11 @@ doit(struct sockaddr *who, socklen_t who
5 error = getnameinfo(who, wholen, namebuf, sizeof(namebuf), NULL, 0, 0);
7 + /* if we can't get a hostname now, settle for an address */
8 + if(error == EAI_AGAIN)
9 + error = getnameinfo(who, wholen, namebuf, sizeof(namebuf),
10 + NULL, 0, NI_NUMERICHOST);
13 perror("getnameinfo: localhost");
14 perror(gai_strerror(error));
15 @@ -681,7 +686,7 @@ doit(struct sockaddr *who, socklen_t who
16 /* Get local host name */
18 struct addrinfo hints;
19 - struct addrinfo *res;
20 + struct addrinfo *res = 0;
23 memset(&hints, '\0', sizeof(hints));
24 @@ -690,11 +695,14 @@ doit(struct sockaddr *who, socklen_t who
26 gethostname(host_name, sizeof(host_name));
27 if ((e = getaddrinfo(host_name, NULL, &hints, &res)) != 0) {
28 - perror("getaddrinfo: localhost");
29 - perror(gai_strerror(e));
31 + if(e != EAI_AGAIN) {
32 + fprintf(stderr, "getaddrinfo: localhost %s\n",
42 #if defined(AUTHENTICATE) || defined(ENCRYPT)