Submitted By: Jim Gifford <jim@linuxfromscratch.org>
Date: 2006-09-09
Initial Package Version: 1.4.2
Upstream Status: Unknown
Origin: http://linuxfromscratch.org/pipermail/lfs-support/2005-January/025868.html
Description: Updates to use newer GLIBC standards

diff -Naur inetutils-1.4.2.orig/ftp/ftp.c inetutils-1.4.2/ftp/ftp.c
--- inetutils-1.4.2.orig/ftp/ftp.c	2002-06-25 20:15:05.000000000 -0700
+++ inetutils-1.4.2/ftp/ftp.c	2006-09-10 10:12:53.000000000 -0700
@@ -119,8 +119,8 @@
 	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;
 		(void) strncpy(hostnamebuf, host, sizeof(hostnamebuf));
 	} else {
diff -Naur inetutils-1.4.2.orig/libinetutils/iruserok.c inetutils-1.4.2/libinetutils/iruserok.c
--- inetutils-1.4.2.orig/libinetutils/iruserok.c	2002-12-11 04:38:00.000000000 -0800
+++ inetutils-1.4.2/libinetutils/iruserok.c	2006-09-10 10:12:52.000000000 -0700
@@ -260,7 +260,7 @@
   register char **pp;
 
   /* Try for raw ip address first. */
-  if (isdigit (*lhost) && (long)(laddr = inet_addr (lhost)) != -1)
+  if (isdigit (*lhost) && (laddr = inet_addr (lhost)) != INADDR_NONE)
     return (raddr == laddr);
 
   /* Better be a hostname. */
diff -Naur inetutils-1.4.2.orig/telnet/commands.c inetutils-1.4.2/telnet/commands.c
--- inetutils-1.4.2.orig/telnet/commands.c	2002-06-25 20:15:06.000000000 -0700
+++ inetutils-1.4.2/telnet/commands.c	2006-09-10 10:12:52.000000000 -0700
@@ -2291,9 +2291,7 @@
 	}
     } else {
 #endif
-	temp = inet_addr(hostp);
-	if (temp != (unsigned long) -1) {
-	    sin.sin_addr.s_addr = temp;
+	if(inet_aton(hostp, &sin.sin_addr) != 0) {
 	    sin.sin_family = AF_INET;
 
 	    if (_hostname)
@@ -2897,8 +2895,7 @@
 		if (!c)
 			cp2 = 0;
 
-		if ((tmp = inet_addr(cp)) != -1) {
-			sin_addr.s_addr = tmp;
+		if (inet_aton(cp, &sin_addr.s_addr) != 0) {
 		} else if (host = gethostbyname(cp)) {
 #if	defined(h_addr)
 			memmove((caddr_t)&sin_addr,
diff -Naur inetutils-1.4.2.orig/tftp/main.c inetutils-1.4.2/tftp/main.c
--- inetutils-1.4.2.orig/tftp/main.c	2001-11-02 13:50:13.000000000 -0800
+++ inetutils-1.4.2/tftp/main.c	2006-09-10 10:12:53.000000000 -0700
@@ -228,8 +228,7 @@
 		strcpy(hostname, host->h_name);
 	} else {
 		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;
