Files
AnyPS5/core
Federico Marras 792fb27631 feat(libc): list each interface's AF_LINK entry in getifaddrs on Linux
getifaddrs listed only the host's IPv4 and IPv6 addresses, so the
per-interface AF_LINK entries FreeBSD's getifaddrs puts first were
missing, and with them the interface index, hardware address, MTU and
counters and every interface without an address.

On Linux each interface now starts with an AF_LINK entry, followed by
its addresses, as FreeBSD 11.4's getifaddrs orders them. Its address is
a sockaddr_dl with the host index, type, name and hardware address
(none for a loopback), sized as FreeBSD's if_attach sizes it. Its
ifa_data is a 152-byte FreeBSD if_data filled as if_data_copy fills it:
type, address and header length, link state, MTU, speed and the host's
packet, byte, error, drop and multicast counters from sysfs, or the
host list's 32-bit counters when sysfs cannot be read. Fields with no
host equivalent are 0 and listed in the debt entry. Windows is
unchanged.
2026-10-19 18:57:12 +02:00
..