Commit Graph

3 Commits

Author SHA1 Message Date
LuisBiceps 5c0610f334 feat(libc): keep getifaddrs flags consistent with their addresses on Linux
Drop IFF_POINTOPOINT from an address without a peer and compute an IPv4 broadcast address the host omits from the netmask, since FreeBSD always provides the address when the flag is set. Check zero port, flowinfo and padding in the test.
2026-10-10 10:23:55 +02:00
LuisBiceps a09b67b142 feat(libc): report getifaddrs errors through errno and handle Windows edge cases
Return -1 with the FreeBSD errno for a null list and for expected host and allocation failures, as getcwd does. On Windows, give an unspecified prefix length a host mask, leave PPP and tunnel adapters without broadcast or point-to-point flags since their peer address is not reported, fall back to if<index> for long NDIS names, and bound the adapter query retries. Compare every entry with the host's own list in the test.
2026-10-10 10:23:55 +02:00
LuisBiceps 7cd185ec79 feat(libc): implement getifaddrs and freeifaddrs
List the host's IPv4 and IPv6 addresses in FreeBSD's struct ifaddrs layout, with FreeBSD sockaddrs and interface flags, from getifaddrs on Linux and GetAdaptersAddresses on Windows. The list is one allocation, so freeifaddrs is a single free.
2026-10-10 10:23:55 +02:00