bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-inetutils] Patch: telnet localhost: Trying 255.255.255.255 on x86_6


From: Dominik Mahrer (Teddy)
Subject: [bug-inetutils] Patch: telnet localhost: Trying 255.255.255.255 on x86_64
Date: Sat, 28 Apr 2007 06:32:36 +0200
User-agent: Thunderbird 1.5.0.10 (Windows/20070221)

Hi all

In the current version 1.5 used on a x86_64 "telnet localhost" results in "Trying 255.255.255.255" what shurely does not work. First I thought I made a config error, but all the other tools (ping, scp) worked fine. Then I realized that the problem was in inetutils running on x86_64, so I wrote a patch for it:

http://www.teddy.ch/patches/inetutils-1.5-inet_addr_fix-1.patch

Regards
Teddy


Submitted By: Teddy <teddy at teddy dot ch>
Date: 2007-04-27
Initial Package Version: 1.5
Upstream Status: Unknown
Origin: Idea taken from patch for version 1.4.2, written by Jim Gifford <jim at 
linuxfromscratch dot org>
Description: Updates to use newer GLIBC standards

diff -Naur inetutils-1.5.orig/ftp/ftp.c inetutils-1.5/ftp/ftp.c
--- inetutils-1.5.orig/ftp/ftp.c        2006-10-12 01:23:17.000000000 +0200
+++ inetutils-1.5/ftp/ftp.c     2007-04-27 17:15:10.000000000 +0200
@@ -119,8 +119,7 @@
        static char hostnamebuf[80];
 
        memset((char *)&hisctladdr, 0, sizeof (hisctladdr));
-       hisctladdr.sin_addr.s_addr = inet_addr(host);
-       if (hisctladdr.sin_addr.s_addr != -1) {
+       if (inet_aton(host, &hisctladdr.sin_addr) != 0) {
                hisctladdr.sin_family = AF_INET;
                strncpy(hostnamebuf, host, sizeof(hostnamebuf));
        } else {
diff -Naur inetutils-1.5.orig/telnet/commands.c inetutils-1.5/telnet/commands.c
--- inetutils-1.5.orig/telnet/commands.c        2006-10-11 23:46:26.000000000 
+0200
+++ inetutils-1.5/telnet/commands.c     2007-04-27 17:08:38.000000000 +0200
@@ -2398,9 +2398,7 @@
 
   freeaddrinfo (result);
 #else /* !IPV6 */
-  temp = inet_addr (hostp);
-  if (temp != (in_addr_t) -1)
-    {
+  if(inet_aton(hostp, &sin.sin_addr) != 0) {
       sin.sin_addr.s_addr = temp;
       sin.sin_family = AF_INET;
     }
diff -Naur inetutils-1.5.orig/tftp/main.c inetutils-1.5/tftp/main.c
--- inetutils-1.5.orig/tftp/main.c      2006-10-12 01:42:52.000000000 +0200
+++ inetutils-1.5/tftp/main.c   2007-04-27 17:14:06.000000000 +0200
@@ -267,9 +267,7 @@
       
     case RESOLVE_NOT_RESOLVED: 
       peeraddr.sin_family = AF_INET;
-      peeraddr.sin_addr.s_addr = inet_addr (argv[1]);
-      if (peeraddr.sin_addr.s_addr == -1)
-       {
+      if (inet_aton(argv[1], &peeraddr.sin_addr) == 0) {
          connected = 0;
          printf ("%s: unknown host\n", argv[1]);
          return;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]