summaryrefslogtreecommitdiff
path: root/source4/lib/replace
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:30:22 +0100
commitc513546cda3d453748c88589b83015489fc6f14f (patch)
tree238dc2b3659e0d66c18d4ea171a666e3fbce4c25 /source4/lib/replace
parent840933cd4eaca75ebb4d63928023e7d1d24f4a8c (diff)
downloadsamba-c513546cda3d453748c88589b83015489fc6f14f.tar.gz
samba-c513546cda3d453748c88589b83015489fc6f14f.tar.bz2
samba-c513546cda3d453748c88589b83015489fc6f14f.zip
libreplace: fix compile errors in getifaddrs.c
Michael (cherry picked from commit 22cdd4cb507022d9c670b7d5cbc8d357b0b91637) (This used to be commit 4da2d999a28c8fd3e93480194a153cf6a10de986)
Diffstat (limited to 'source4/lib/replace')
-rw-r--r--source4/lib/replace/getifaddrs.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/source4/lib/replace/getifaddrs.c b/source4/lib/replace/getifaddrs.c
index 4037d647d7..f12062bd8e 100644
--- a/source4/lib/replace/getifaddrs.c
+++ b/source4/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;