Blame SOURCES/telnet-0.17-pek.patch

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