function Radius::setNasIpAddress() always tries to populate the NAS-IP-Address attribute, which is IPv4 only.
When invoking the lib from an IPv6 host without arguments, or the hostname as argument, this will resolve the hostname to its IPv4 address, and incorrectly create a RADIUS packet that has an IPv4 address in NAS-IP-Address, even though the request is /actually/ sent over IPv6
When invoking the lib from an IPv6 host with an explicit IPv6 address or a $_SERVER['SERVER_ADDR'] like 2001:db8::1, the function will fail because the input is neither a reswolvable hostname nor an IPv4 address.
Suggestions:
improve the function to detect IPv6 addresses in its first parameter, and populate the NAS-IPv6-Address attribute instead of NAS-IP-Address if so
for bonus points: if no argument, or argument is a hostname, determine the address family the code is currently executed on, and resolve the hostname to the matching family, and populate the corresponding attribute
function Radius::setNasIpAddress() always tries to populate the NAS-IP-Address attribute, which is IPv4 only.
When invoking the lib from an IPv6 host without arguments, or the hostname as argument, this will resolve the hostname to its IPv4 address, and incorrectly create a RADIUS packet that has an IPv4 address in NAS-IP-Address, even though the request is /actually/ sent over IPv6
When invoking the lib from an IPv6 host with an explicit IPv6 address or a $_SERVER['SERVER_ADDR'] like 2001:db8::1, the function will fail because the input is neither a reswolvable hostname nor an IPv4 address.
Suggestions: