source: patches/inetutils-1.4.2-inet_addr_fix-1.patch@ 0c3999a

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 0c3999a was a48d7758, checked in by Justin Knierim <cross-lfs@…>, 18 years ago

Renamed inetutils patch to inet_addr_fix.

  • Property mode set to 100644
File size: 2.6 KB
RevLine 
[d84a4b2]1Submitted By: Jim Gifford <jim@linuxfromscratch.org>
2Date: 2006-09-09
3Initial Package Version: 1.4.2
4Upstream Status: Unknown
5Origin: http://linuxfromscratch.org/pipermail/lfs-support/2005-January/025868.html
6Description: Updates to use newer GLIBC standards
7
8diff -Naur inetutils-1.4.2.orig/ftp/ftp.c inetutils-1.4.2/ftp/ftp.c
9--- inetutils-1.4.2.orig/ftp/ftp.c 2002-06-25 20:15:05.000000000 -0700
10+++ inetutils-1.4.2/ftp/ftp.c 2006-09-10 10:12:53.000000000 -0700
11@@ -119,8 +119,8 @@
12 static char hostnamebuf[80];
13
14 memset((char *)&hisctladdr, 0, sizeof (hisctladdr));
15- hisctladdr.sin_addr.s_addr = inet_addr(host);
16- if (hisctladdr.sin_addr.s_addr != -1) {
17+
18+ if (inet_aton(host, &hisctladdr.sin_addr) != 0) {
19 hisctladdr.sin_family = AF_INET;
20 (void) strncpy(hostnamebuf, host, sizeof(hostnamebuf));
21 } else {
22diff -Naur inetutils-1.4.2.orig/libinetutils/iruserok.c inetutils-1.4.2/libinetutils/iruserok.c
23--- inetutils-1.4.2.orig/libinetutils/iruserok.c 2002-12-11 04:38:00.000000000 -0800
24+++ inetutils-1.4.2/libinetutils/iruserok.c 2006-09-10 10:12:52.000000000 -0700
25@@ -260,7 +260,7 @@
26 register char **pp;
27
28 /* Try for raw ip address first. */
29- if (isdigit (*lhost) && (long)(laddr = inet_addr (lhost)) != -1)
30+ if (isdigit (*lhost) && (laddr = inet_addr (lhost)) != INADDR_NONE)
31 return (raddr == laddr);
32
33 /* Better be a hostname. */
34diff -Naur inetutils-1.4.2.orig/telnet/commands.c inetutils-1.4.2/telnet/commands.c
35--- inetutils-1.4.2.orig/telnet/commands.c 2002-06-25 20:15:06.000000000 -0700
36+++ inetutils-1.4.2/telnet/commands.c 2006-09-10 10:12:52.000000000 -0700
37@@ -2291,9 +2291,7 @@
38 }
39 } else {
40 #endif
41- temp = inet_addr(hostp);
42- if (temp != (unsigned long) -1) {
43- sin.sin_addr.s_addr = temp;
44+ if(inet_aton(hostp, &sin.sin_addr) != 0) {
45 sin.sin_family = AF_INET;
46
47 if (_hostname)
48@@ -2897,8 +2895,7 @@
49 if (!c)
50 cp2 = 0;
51
52- if ((tmp = inet_addr(cp)) != -1) {
53- sin_addr.s_addr = tmp;
54+ if (inet_aton(cp, &sin_addr.s_addr) != 0) {
55 } else if (host = gethostbyname(cp)) {
56 #if defined(h_addr)
57 memmove((caddr_t)&sin_addr,
58diff -Naur inetutils-1.4.2.orig/tftp/main.c inetutils-1.4.2/tftp/main.c
59--- inetutils-1.4.2.orig/tftp/main.c 2001-11-02 13:50:13.000000000 -0800
60+++ inetutils-1.4.2/tftp/main.c 2006-09-10 10:12:53.000000000 -0700
61@@ -228,8 +228,7 @@
62 strcpy(hostname, host->h_name);
63 } else {
64 peeraddr.sin_family = AF_INET;
65- peeraddr.sin_addr.s_addr = inet_addr(argv[1]);
66- if (peeraddr.sin_addr.s_addr == -1) {
67+ if (inet_aton(argv[1], &peeraddr.sin_addr) == 0) {
68 connected = 0;
69 printf("%s: unknown host\n", argv[1]);
70 return;
Note: See TracBrowser for help on using the repository browser.