Blame SOURCES/telnet-0.17-pek.patch

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