Blame SOURCES/telnet-0.17-pek.patch

b76cf7
diff -u telnet/commands.c telnet.new/commands.c
b76cf7
--- telnet/commands.c	Sat Sep  1 12:55:18 2001
b76cf7
+++ telnet.new/commands.c	Sat Sep  1 12:54:36 2001
b76cf7
@@ -2354,6 +2354,7 @@
b76cf7
 	hints.ai_flags = AI_CANONNAME;
b76cf7
 	if (portp == NULL) {
b76cf7
 		portp = "telnet";
b76cf7
+		telnetport = 1;
b76cf7
 	} else if (*portp == '-') {
b76cf7
 		portp++;
b76cf7
 		telnetport = 1;
b76cf7
@@ -2397,7 +2398,6 @@
b76cf7
 	    if (error) {
b76cf7
 	        warn("%s: %s", aliasp, gai_strerror(error));
b76cf7
 	        close(net);
b76cf7
-	        freeaddrinfo(ares);
b76cf7
 	        continue;
b76cf7
 	    }
b76cf7
 	    if (bind(net, ares->ai_addr, ares->ai_addrlen) < 0) {
b76cf7
@@ -2414,7 +2414,7 @@
b76cf7
 		perror("setsockopt (IP_OPTIONS)");
b76cf7
 #endif
b76cf7
 #if	defined(IPPROTO_IP) && defined(IP_TOS)
b76cf7
-	{
b76cf7
+	if (res->ai_family == AF_INET) {
b76cf7
 # if	defined(HAS_GETTOS)
b76cf7
 	    struct tosent *tp;
b76cf7
 	    if (tos < 0 && (tp = gettosbyname("telnet", "tcp")))
b76cf7
@@ -2438,7 +2438,7 @@
b76cf7
 	    char hbuf[NI_MAXHOST];
b76cf7
 	    
b76cf7
 	    if (getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, sizeof(hbuf),
b76cf7
-		    NULL, 0, NI_NUMERICHOST) != 0) {
b76cf7
+		    NULL, 0, niflags) != 0) {
b76cf7
 	        strcpy(hbuf, "(invalid)");
b76cf7
 	    }
b76cf7
 	    fprintf(stderr, "telnet: connect to address %s: %s\n", hbuf,