Blame SOURCES/telnet-0.17-pek.patch

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