summaryrefslogtreecommitdiff
path: root/source3/lib/replace/getifaddrs.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-02-21 18:16:10 +0100
committerMichael Adam <obnox@samba.org>2008-02-21 18:16:10 +0100
commitbf6dbf8e1b371770a2c9df99b27569c36587df39 (patch)
treef2c203c80e13a5bc44030fb8fd4ace2c5024b71b /source3/lib/replace/getifaddrs.c
parent357659b1d0c2844b328ae14478a842e111db5c7c (diff)
downloadsamba-bf6dbf8e1b371770a2c9df99b27569c36587df39.tar.gz
samba-bf6dbf8e1b371770a2c9df99b27569c36587df39.tar.bz2
samba-bf6dbf8e1b371770a2c9df99b27569c36587df39.zip
libreplace: fix compile errors in getifaddrs.c
Michael (This used to be commit 22cdd4cb507022d9c670b7d5cbc8d357b0b91637)
Diffstat (limited to 'source3/lib/replace/getifaddrs.c')
-rw-r--r--source3/lib/replace/getifaddrs.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/source3/lib/replace/getifaddrs.c b/source3/lib/replace/getifaddrs.c
index 4037d647d7..f12062bd8e 100644
--- a/source3/lib/replace/getifaddrs.c
+++ b/source3/lib/replace/getifaddrs.c
@@ -81,7 +81,6 @@ int rep_getifaddrs(struct ifaddrs **ifap)
char buff[8192];
int fd, i, n;
struct ifreq *ifr=NULL;
- int total = 0;
struct in_addr ipaddr;
struct in_addr nmask;
char *iname;
@@ -106,7 +105,7 @@ int rep_getifaddrs(struct ifaddrs **ifap)
n = ifc.ifc_len / sizeof(struct ifreq);
/* Loop through interfaces, looking for given IP address */
- for (i=n-1;i>=0 && total < max_interfaces;i--) {
+ for (i=n-1; i>=0; i--) {
if (ioctl(fd, SIOCGIFADDR, &ifr[i]) != 0) {
freeifaddrs(*ifap);
}
@@ -166,11 +165,10 @@ int rep_getifaddrs(struct ifaddrs **ifap)
char buff[8192];
int fd, i, n;
struct ifreq *ifr=NULL;
- int total = 0;
struct in_addr ipaddr;
struct in_addr nmask;
char *iname;
- struct ifaddrs *curif;
+ struct ifaddrs *curif, *lastif;
*ifap = NULL;
@@ -201,7 +199,7 @@ int rep_getifaddrs(struct ifaddrs **ifap)
/* Loop through interfaces */
- for (i = 0; i<n && total < max_interfaces; i++) {
+ for (i = 0; i<n; i++) {
ifreq = ifr[i];
curif = calloc(1, sizeof(struct ifaddrs));
@@ -270,7 +268,6 @@ int rep_getifaddrs(struct ifaddrs **ifap)
struct in_addr ipaddr;
struct in_addr nmask;
char *iname;
- int total = 0;
struct ifaddrs *curif, *lastif;
*ifap = NULL;