Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ability to populate NAS-IPv6-Address instead of NAS-IP-Address #26

Open
restena-sw opened this issue Sep 21, 2022 · 0 comments · May be fixed by #27
Open

ability to populate NAS-IPv6-Address instead of NAS-IP-Address #26

restena-sw opened this issue Sep 21, 2022 · 0 comments · May be fixed by #27

Comments

@restena-sw
Copy link

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
@tvdijen tvdijen linked a pull request Sep 21, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant