Skip Menu |

This queue is for tickets about the Socket CPAN distribution.

Report information
The Basics
Id: 99706
Status: rejected
Priority: 0/
Queue: Socket

People
Owner: Nobody in particular
Requestors: justincase [...] yopmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: inet_aton doesn't return undef for this unresolveable address
perl -MSocket -e 'print inet_pton(q[12345.6])."\n"' | hexdump See this ticket for more context: https://rt.cpan.org/Public/Bug/Display.html?id=99448
From: justincase [...] yopmail.com
On Tue Oct 21 16:33:22 2014, justincase wrote: Show quoted text
> perl -MSocket -e 'print inet_pton(q[12345.6])."\n"' | hexdump
That's supposed to be inet_aton above.
There's not a lot that Socket.xs can do about this. All it does is provides a Perl<->C wrapping function to call the platform's underlying inet_aton() function in the C library. If the C library doesn't error, and instead returns a result, then that is the result that the Perl wrapping returns. Try comparing it to a native C program to do the same thing - if that C program also gives a resolved result, then that's the result the Perl one should provide too. -- Paul Evans
On Fri Feb 13 09:13:24 2015, PEVANS wrote: Show quoted text
> There's not a lot that Socket.xs can do about this. > > All it does is provides a Perl<->C wrapping function to call the > platform's underlying inet_aton() function in the C library. If the C > library doesn't error, and instead returns a result, then that is the > result that the Perl wrapping returns. > > Try comparing it to a native C program to do the same thing - if that > C program also gives a resolved result, then that's the result the > Perl one should provide too.
In fact moreover, that's the correct behaviour. `inet_aton()` has lots of interesting legacy ways to represent addresses. The above is a valid form. -- Paul Evans