Fix linked list of ifaddrs in implementations of rep_getifaddrs.
[kai/samba.git] / source3 / lib / replace / getifaddrs.c
index 60049caa99050f878ac5b4610b1d6fa0c282d52f..37cd950e0979bfc9404c61145b3c2548efbba176 100644 (file)
@@ -115,7 +115,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);
@@ -208,7 +208,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;
@@ -306,7 +306,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);