Handle hostnames in fr_pton4/6 #1919

Merged
merged 1 commit into from Feb 21, 2017

Conversation

Projects
None yet
2 participants
Collaborator

spbnick commented Feb 21, 2017

Make fr_pton4/6 handle hostnames longer than the longest address +
prefix.

This fixes the issue where a long hostname would be rejected by e.g. radclient as an invalid IP address. E.g.:

$ radclient -x foofoof.barbarb.bazbazb.com auth testing123
radclient: Invalid IPv4 address string "foofoof.barbarb.bazbazb.com"

Whereas the expected response (produced after the fix) is:

radclient: Failed resolving "foofoof.barbarb.bazbazb.com" to IPv4 address: Name or service not known
Owner

arr2036 commented Feb 21, 2017

Just increase the buffer size to 256. This has already been changed in v4.0.x.

There's actually a 255 byte limit defined in RFC 1035 Section 2.3.4.

@spbnick spbnick Handle hostnames in fr_pton4/6
Make fr_pton4/6 handle hostnames longer than the longest address +
prefix.
d825d4e
Collaborator

spbnick commented Feb 21, 2017

Ah, I looked but failed to find that RFC. Updated, thanks, Arran.

@arr2036 arr2036 merged commit 0624078 into FreeRADIUS:v3.0.x Feb 21, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

spbnick deleted the spbnick:fr_pton4_hostname_fix branch Feb 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment