Fix network-interface-list|info on newer BSD derived OS:es.
authorJan Djärv <jan.h.d@swipnet.se>
Sat, 13 Aug 2011 10:48:03 +0000 (12:48 +0200)
committerJan Djärv <jan.h.d@swipnet.se>
Sat, 13 Aug 2011 10:48:03 +0000 (12:48 +0200)
commit377538cbcf8c1f0aab9b40ed2ff3df414904272f
tree9dfd855ba3e99732fd5d3f49096a5191c09233f3
parent1bca59fe757d359e3c36d3de1c8ec19ed90be49c
Fix network-interface-list|info on newer BSD derived OS:es.

* configure.in: Add header check: sys/socket.h,
ifaddrs.h, net/if_dl.h.  Check for getifaddrs and freeifaddrs.
Check for sa_len in struct ifreq.ifr_addr (Bug#8477).

* src/process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
(Fnetwork_interface_list): Allocate in increments of bytes instead
of sizeof (struct ifreq).  Iterate over ifconf.ifc_req by counting
bytes (Bug#8477).  Count bytes correctly when ifr_addr is a struct
sockaddr.
(struct ifflag_def): notrailers is smart on OSX.
(Fnetwork_interface_info): Handle case when ifr_flags is negative.
Get hardware address with getifaddrs if available.
ChangeLog
configure.in
src/ChangeLog
src/process.c