Commit b97feea8 authored by Andreas Gustafsson's avatar Andreas Gustafsson
Browse files

bind 8 #734: linux only fills in as many entries as will fill the buffer with SIOCGIFCONF

parent 9d308c62
......@@ -86,7 +86,19 @@ isc_interfaceiter_create(isc_mem_t *mctx, isc_interfaceiter_t **iterp)
iter->ifc.ifc_len = iter->bufsize;
iter->ifc.ifc_buf = iter->buf;
if (ioctl(iter->socket, SIOCGIFCONF, (char *) &iter->ifc) >= 0)
break;
{
/*
* Some OS's just return what will fit rather
* than set EINVAL if the buffer is too small
* to fit all the interfaces in. If
* ifc.ifc_len is too near to the end of the
* buffer we will grow it just in case and
* retry.
*/
if (iter->ifc.ifc_len + 2 * sizeof(struct ifreq)
< iter->bufsiz)
break;
}
if (errno != EINVAL) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"get interface configuration: %s",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment