Skip Menu |
 

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 14653
Status: resolved
Priority: 0/
Queue: Net-DNS

People
Owner: Nobody in particular
Requestors: robert [...] martin-legene.dk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.53_01
Fixed in: (no value)

Attachments


Subject: Resolver fails TCP lookups on FreeBSD (IPv4) jail if kernel has IPv6 support.
Download (untitled) / with headers
text/plain 415b
Server is running FreeBSD 5.4. Kernel has support for IPv4 and IPv6. A jail has only IPv4 transport due to the current nature of FreeBSD-jails. Net::DNS assumes a TCP6 socket can be created but doesn't try to fall back to v4. The attached patch solves this issue. If the IO::Socket::INET6 call fails with EINVAL it will try IPv4. I hope it doesn't introduce other problems ;-) Let me know what you think. -- robert
Download Resolver.patch
text/x-diff 1.3k
*** Resolver/Base.pm.459 Fri Jul 22 14:13:50 2005 --- Resolver/Base.pm Tue Sep 20 00:43:20 2005 *************** *** 586,591 **** --- 586,592 ---- #my $old_wflag = $^W; #$^W = 0; + $sock = undef; if ($has_inet6 && ! $self->force_v4()){ # XXX IO::Socket::INET6 fails in a cryptic way upon send() # on AIX5L if "0" is passed in as LocalAddr *************** *** 603,609 **** Timeout => $timeout, ); ! }else{ $sock = IO::Socket::INET->new( PeerAddr => $ns, PeerPort => $dstport, --- 604,614 ---- Timeout => $timeout, ); ! } ! # OS might support IPv6 in kernel, but can't ! # really get an IPv6 socket. A reason might be ! # that we're a jailed process. -- robert ! if (not defined $sock and exists $!{EINVAL}) { $sock = IO::Socket::INET->new( PeerAddr => $ns, PeerPort => $dstport,
From: Robert
Download (untitled) / with headers
text/plain 217b
Maybe I should add that I found this problem while trying Josefsson's DNSSEC walker from http://www.josefsson.org/walker/ call it with the following syntax: robert@jail$ walker -d @a.ns.se se (also try without -d)
Download (untitled) / with headers
text/plain 281b
[guest - Mon Sep 19 18:53:59 2005]: Show quoted text
> Maybe I should add that I found this problem while trying Josefsson's > DNSSEC walker from http://www.josefsson.org/walker/ call it with the > following syntax: > > robert@jail$ walker -d @a.ns.se se > (also try without -d)
Acknowledged.
Download (untitled) / with headers
text/plain 261b
[OLAF - Mon Sep 26 08:56:01 2005]: I dont think my patch will make people with only IPv4 very happy. Skip the " and exists $!{EINVAL}" from my patch. I wonder under which scenarios the tcp6 setup will fail now, but then it would fall back to tcp4 at least.
From: "Olaf M. Kolkman" <olaf [...] dacht.net>
Subject: Re: [cpan #14653] Resolver fails TCP lookups on FreeBSD (IPv4) jail if kernel has IPv6 support.
Date: Mon, 26 Sep 2005 16:49:48 +0200
To: bug-Net-DNS [...] rt.cpan.org
RT-Send-Cc:
Download (untitled) / with headers
text/plain 963b
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sep 26, 2005, at 15:40 , Guest via RT wrote: Show quoted text
> > This message about Net-DNS was sent to you by guest <> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=14653 > > > [OLAF - Mon Sep 26 08:56:01 2005]: > > I dont think my patch will make people with only IPv4 very happy.
I had not yet applied the patch. Actually I want to be very careful with that piece of code. Things are intertwined pretty thoroughly and it has costs a number of releases to get it bug free. So if the force_v4 method is sufficient to force your application to do the good thing I'd like to not touch the code. - --Olaf -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: This message is locally signed. iD8DBQFDOAqNtN/ca3YJIocRAsAJAKCxKAydihJtPsQOd4sO5yOVwyDoSgCfc9UF mISFTHTB6gfxjNMAKb9WeJg= =KyNh -----END PGP SIGNATURE-----
From: Robert Martin-Legene
Download (untitled) / with headers
text/plain 636b
Hi Olaf. I understand your concern very well. Btw, this problem seems to be exactly the same as Bug#14049 "TCP connections seem to be buggy". While r.felber was playing around with his own code and could call force_v4() if he had enough details about his environment, I guess I was in a different position because Net::DNS was just used as an API to something else. So if a user (not me) :) of $randomsoftware has to fix $randomsoftware to call force_v4() to be able to use it, I think Net::DNS's value will be perceived less than what I believe it's worth. To me it seems it's an area which demands some attention. -- robert
Download (untitled) / with headers
text/plain 147b
I reordered some code, moved some conditionals and fixed the problem. Robert tested and acknowledged. The fixed code lives on the trunk. --Olaf


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.