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:
@ -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);
|
||||
|
Reference in New Issue
Block a user