code to retry on SIOCGIFCONF not returning all interfaces is broken,
this unreasonably large buffer should handle the case of a machine
with lots of (usually virtual) interfaces. dhcpd 4 uses a different
method to get interface configuration, so this kludge should go away
on upgrade.
Fix based on understanding of the code, but has been compile-tested
only, to address failure report received from Michael Graff.
next ifreq is sizeof(struct ifreq) after the current one unless the
sockaddr is bigger than the union in ifreq that holds it.
In the original 4.4BSD code, this interpretation results in the same
behavior as the "is the sockaddr bigger than struct sockaddr", because
sizeof(struct sockaddr) and sizeof(ifc->ifr_ifru) are the same.
Add comments pointing out problems in the 'need bigger buffer' code,
and copying excessive amounts of data.
a bunch of small daemons that seem small packet flows can easily chew up
significant kernel memory (each BPF device opened takes 2*buffersize of
wired memory.) In each of these applications, add code to set the buffer
size to 32k before setting the interface.
the ISC DHCP server to fail to start when it is configured to use the
ad-hoc DNS update mechanism. This fixes PR#20460 and PR#23284 (once
this is pulled up to the 1.6 branch).
with Ted Lemon leave in checks for IFF_LOOPBACK and IFF_POINTTOPOINT
in case an OS incorrectly marks them with IFF_BROADCAST.
Patch submitted back to dhcp-server@isc.org