diff options
author | Jeremy Allison <jra@samba.org> | 2008-02-22 13:38:03 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2008-02-22 13:38:03 -0800 |
commit | 49a367ed32a98c9bf48addfa3a4e16c1d6e444ff (patch) | |
tree | e9430b7bfca330050e0d040b583bba8893415643 /source3/lib/replace/getifaddrs.c | |
parent | 5df1d8d550d66b1e52219bd15d24af5146c55ceb (diff) | |
parent | d88e40106f2864e0e105b5d4fe7c25c577df8643 (diff) | |
download | samba-49a367ed32a98c9bf48addfa3a4e16c1d6e444ff.tar.gz samba-49a367ed32a98c9bf48addfa3a4e16c1d6e444ff.tar.bz2 samba-49a367ed32a98c9bf48addfa3a4e16c1d6e444ff.zip |
Merge branch 'v3-2-test' of ssh://jra@git.samba.org/data/git/samba into v3-2-test
(This used to be commit bcc5371b8e7f369e8d830d9cf687089514997248)
Diffstat (limited to 'source3/lib/replace/getifaddrs.c')
-rw-r--r-- | source3/lib/replace/getifaddrs.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source3/lib/replace/getifaddrs.c b/source3/lib/replace/getifaddrs.c index f12062bd8e..053657475d 100644 --- a/source3/lib/replace/getifaddrs.c +++ b/source3/lib/replace/getifaddrs.c @@ -19,6 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#define SOCKET_WRAPPER_NOT_REPLACE + #include "replace.h" #include "system/network.h" @@ -84,7 +86,8 @@ int rep_getifaddrs(struct ifaddrs **ifap) struct in_addr ipaddr; struct in_addr nmask; char *iname; - struct ifaddrs *curif, *lastif; + struct ifaddrs *curif; + struct ifaddrs *lastif = NULL; *ifap = NULL; @@ -114,7 +117,7 @@ int rep_getifaddrs(struct ifaddrs **ifap) if (lastif == NULL) { *ifap = curif; } else { - lastif->ifa_next = (*ifap); + lastif->ifa_next = curif; } curif->ifa_name = strdup(ifr[i].ifr_name); @@ -168,7 +171,8 @@ int rep_getifaddrs(struct ifaddrs **ifap) struct in_addr ipaddr; struct in_addr nmask; char *iname; - struct ifaddrs *curif, *lastif; + struct ifaddrs *curif; + struct ifaddrs *lastif = NULL; *ifap = NULL; @@ -206,7 +210,7 @@ int rep_getifaddrs(struct ifaddrs **ifap) if (lastif == NULL) { *ifap = curif; } else { - lastif->ifa_next = (*ifap); + lastif->ifa_next = curif; } strioctl.ic_cmd = SIOCGIFFLAGS; @@ -268,7 +272,8 @@ int rep_getifaddrs(struct ifaddrs **ifap) struct in_addr ipaddr; struct in_addr nmask; char *iname; - struct ifaddrs *curif, *lastif; + struct ifaddrs *curif; + struct ifaddrs *lastif = NULL; *ifap = NULL; @@ -303,7 +308,7 @@ int rep_getifaddrs(struct ifaddrs **ifap) if (lastif == NULL) { *ifap = curif; } else { - lastif->ifa_next = (*ifap); + lastif->ifa_next = curif; } curif->ifa_name = strdup(ifr->ifr_name); @@ -360,7 +365,7 @@ int rep_getifaddrs(struct ifaddrs **ifap) #endif #ifdef AUTOCONF_TEST -/* this is the autoconf driver to test get_interfaces() */ +/* this is the autoconf driver to test getifaddrs() */ int main() { |