support SIOCGIFCONF returning more interfaces than there's space in the supplied buffer

This commit is contained in:
Arvid Norberg
2012-05-13 04:43:22 +00:00
parent 2d0464fde7
commit 36f7228001

View File

@@ -446,7 +446,7 @@ namespace libtorrent
} }
ifconf ifc; ifconf ifc;
// make sure the buffer is aligned to hold ifreq structs // make sure the buffer is aligned to hold ifreq structs
ifreq buf[30]; ifreq buf[40];
ifc.ifc_len = sizeof(buf); ifc.ifc_len = sizeof(buf);
ifc.ifc_buf = (char*)buf; ifc.ifc_buf = (char*)buf;
if (ioctl(s, SIOCGIFCONF, &ifc) < 0) if (ioctl(s, SIOCGIFCONF, &ifc) < 0)
@@ -520,7 +520,6 @@ namespace libtorrent
ifr += current_size; ifr += current_size;
remaining -= current_size; remaining -= current_size;
} }
TORRENT_ASSERT(remaining == 0);
close(s); close(s);
#elif TORRENT_USE_GETADAPTERSADDRESSES #elif TORRENT_USE_GETADAPTERSADDRESSES