mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-08 20:52:05 -04:00
bind 8 #734: linux only fills in as many entries as will fill the buffer with SIOCGIFCONF
This commit is contained in:
parent
9d308c6236
commit
b97feea8fd
1 changed files with 13 additions and 1 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue