From ed3c62f8932c151c211d064f95daed3f1f208f80 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Fri, 28 Apr 1995 06:26:57 +0000 Subject: [PATCH] we don't have sa_len in sockaddr --- pppd/sys-aix4.c | 7 ++++--- pppd/sys-linux.c | 5 ++--- pppd/sys-str.c | 7 ++++--- pppd/sys-ultrix.c | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pppd/sys-aix4.c b/pppd/sys-aix4.c index e96e520..b6485ec 100644 --- a/pppd/sys-aix4.c +++ b/pppd/sys-aix4.c @@ -19,7 +19,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-aix4.c,v 1.4 1995/04/27 00:33:49 paulus Exp $"; +static char rcsid[] = "$Id: sys-aix4.c,v 1.5 1995/04/28 06:25:40 paulus Exp $"; #endif /* @@ -1114,6 +1114,8 @@ get_ether_addr(ipaddr, hwaddr) * network as `addr'. If we find any, we OR in their netmask to the * user-specified netmask. */ +#define MAX_IFS 32 + u_int32_t GetMask(addr) u_int32_t addr; @@ -1143,8 +1145,7 @@ GetMask(addr) return mask; } ifend = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len); - for (ifr = ifc.ifc_req; ifr < ifend; ifr = (struct ifreq *) - ((char *)&ifr->ifr_addr + ifr->ifr_addr.sa_len)) { + for (ifr = ifc.ifc_req; ifr < ifend; ++ifr) { /* * Check the interface's internet address. */ diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index 34830f0..946a2f9 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include @@ -1184,8 +1184,7 @@ GetMask(addr) return mask; } ifend = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len); - for (ifr = ifc.ifc_req; ifr < ifend; ifr = (struct ifreq *) - ((char *)&ifr->ifr_addr + ifr->ifr_addr.sa_len)) { + for (ifr = ifc.ifc_req; ifr < ifend; ifr++) { /* * Check the interface's internet address. */ diff --git a/pppd/sys-str.c b/pppd/sys-str.c index 051f10d..f5afba9 100644 --- a/pppd/sys-str.c +++ b/pppd/sys-str.c @@ -19,7 +19,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-str.c,v 1.18 1995/04/27 00:35:43 paulus Exp $"; +static char rcsid[] = "$Id: sys-str.c,v 1.19 1995/04/28 06:26:46 paulus Exp $"; #endif /* @@ -1107,6 +1107,8 @@ logwtmp(line, name, host) * network as `addr'. If we find any, we OR in their netmask to the * user-specified netmask. */ +#define MAX_IFS 32 + u_int32_t GetMask(addr) u_int32_t addr; @@ -1136,8 +1138,7 @@ GetMask(addr) return mask; } ifend = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len); - for (ifr = ifc.ifc_req; ifr < ifend; ifr = (struct ifreq *) - ((char *)&ifr->ifr_addr + ifr->ifr_addr.sa_len)) { + for (ifr = ifc.ifc_req; ifr < ifend; ++ifr) { /* * Check the interface's internet address. */ diff --git a/pppd/sys-ultrix.c b/pppd/sys-ultrix.c index d8653f1..879aeda 100644 --- a/pppd/sys-ultrix.c +++ b/pppd/sys-ultrix.c @@ -19,7 +19,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-ultrix.c,v 1.9 1995/04/27 00:45:24 paulus Exp $"; +static char rcsid[] = "$Id: sys-ultrix.c,v 1.10 1995/04/28 06:26:57 paulus Exp $"; #endif /* @@ -1012,7 +1012,7 @@ GetMask(addr) } ifend = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len); for (ifr = ifc.ifc_req; ifr < ifend; ifr = (struct ifreq *) - ((char *)&ifr->ifr_addr + ifr->ifr_addr.sa_len)) { + ((char *)&ifr->ifr_addr + sizeof(struct sockaddr))) { /* * Check the interface's internet address. */ -- 2.39.2