]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/patches/telnet-0.17-pek.patch0
telnet: new addon
[people/teissler/ipfire-2.x.git] / src / patches / telnet-0.17-pek.patch0
diff --git a/src/patches/telnet-0.17-pek.patch0 b/src/patches/telnet-0.17-pek.patch0
new file mode 100644 (file)
index 0000000..0f4c400
--- /dev/null
@@ -0,0 +1,37 @@
+diff -u telnet/commands.c telnet.new/commands.c
+--- telnet/commands.c  Sat Sep  1 12:55:18 2001
++++ telnet.new/commands.c      Sat Sep  1 12:54:36 2001
+@@ -2354,6 +2354,7 @@
+       hints.ai_flags = AI_CANONNAME;
+       if (portp == NULL) {
+               portp = "telnet";
++              telnetport = 1;
+       } else if (*portp == '-') {
+               portp++;
+               telnetport = 1;
+@@ -2397,7 +2398,6 @@
+           if (error) {
+               warn("%s: %s", aliasp, gai_strerror(error));
+               close(net);
+-              freeaddrinfo(ares);
+               continue;
+           }
+           if (bind(net, ares->ai_addr, ares->ai_addrlen) < 0) {
+@@ -2414,7 +2414,7 @@
+               perror("setsockopt (IP_OPTIONS)");
+ #endif
+ #if   defined(IPPROTO_IP) && defined(IP_TOS)
+-      {
++      if (res->ai_family == AF_INET) {
+ # if  defined(HAS_GETTOS)
+           struct tosent *tp;
+           if (tos < 0 && (tp = gettosbyname("telnet", "tcp")))
+@@ -2438,7 +2438,7 @@
+           char hbuf[NI_MAXHOST];
+           
+           if (getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, sizeof(hbuf),
+-                  NULL, 0, NI_NUMERICHOST) != 0) {
++                  NULL, 0, niflags) != 0) {
+               strcpy(hbuf, "(invalid)");
+           }
+           fprintf(stderr, "telnet: connect to address %s: %s\n", hbuf,