1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-29 13:49:30 +03:00

Fix linked list of ifaddrs in implementations of rep_getifaddrs.

Produce proper list instead of one-node-loop.

Michael
(cherry picked from commit ec9f4f5066)
This commit is contained in:
Michael Adam
2008-02-22 00:27:00 +01:00
parent 5bd613a2cd
commit 744d5ba7ad

View 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);