Subject: | "reverse_lookups" and "allow" fails when listening to IPv6 socket |
I am trying to use a configuration similar to this one:
reverse_lookups 1
allow ^foo\.lan$
host 172.16.0.1
The above works (i.e. allows connection from "foo.lan").
But if I try to bind the server to IPv6, then connections from "foo.lan" are rejected:
reverse_lookups 1
allow ^foo\.lan$
host *
In this case the reverse DNS lookup attempted by Net::Server seems to fail.
The following lines in Net/Server.pm seem to be the culprit:
if ($addr && defined $prop->{'reverse_lookups'}) {
if ($INC{'Socket6.pm'} && Socket6->can('getnameinfo')) {
my @res = Socket6::getnameinfo($client->peerhost, 0);
$prop->{'peerhost'} = $res[0] if @res > 1;
The above fails to resolve the hostname "foo.lan" for a connection via IPv4 as well as IPv6.
The local name resolution for the IPv4 and IPv6 address of "foo.lan" itself works (tested via "dig -x ...").
My perl is not good enough to discern, what exactly goes wrong in the above code snippet. Maybe someone has an idea?
Thank you!