Subject: | Bug in Net::DNS::Resolver::Base |
Date: | Mon, 04 Aug 2014 11:48:11 +0200 |
To: | bug-Net-DNS [...] rt.cpan.org |
From: | Jens Wagner <jwagner [...] hexonet.net> |
Dear Team of Net::DNS,
there is a Bug in Net/DNS/Resolver/Base.pm, that can be fixed using the
patch attached to this email.
Version of Net-DNS used: 0.78
Issue: The constructor "sub new" does not properly copy the $defaults
hash reference, before making changes, therefore independent
Net::DNS::Resolver objects affect each other.
The fix is to simply apply a deep copy on the $defaults hash ref.
Example code triggering the bug:
# ------------------------------------------------------------------
use Net::DNS;
my $resolver = new Net::DNS::Resolver (
nameservers => ['some-non-existing-ns.'],
recurse => 0,
);
my $resolver2 = new Net::DNS::Resolver (
nameservers => ['ns1.hexonet.net.'],
recurse => 0,
debug => 1
);
$resolver2->query("www.hexonet.net.");
# ------------------------------------------------------------------
$resolver2 does not work, as 'ns1.hexonet.net.' doesn't get resolved.
(because the $resolver constructor above overwrote the $defaults).
$resolver2 works however, when removing $resolver, or applying the patch.
Please let me know, if you need further infos. And thanks a lot for
maintaining Net::DNS + Net::DNS::SEC!
Best,
- jens
--
Jens Wagner
Chief Executive Officer
HEXONET GmbH
T: +49 6841 69 84 0
F: +49 6841 69 84 199
E: jwagner@hexonet.net
W: http://www.hexonet.net
HEXONET GmbH, Talstrasse 27, 66424 Homburg, Germany. CEO & General Manager: Jens Wagner, HRB 2839 (HOM), Amtsgericht Saarbrücken, VAT-ID: DE-138316882
HEXONET Services Inc., #2235 - 6900 Graybar Road, Richmond, B.C., V6W 0A5, Canada. CSO & General Manager: Robert Birkner
This email and any files transmitted are confidential and intended only or the person(s) directly addressed. If you are not the intended recipient, any use, copying, transmission, distribution, or other forms of dissemination is strictly prohibited. If you have received this email in error, please notify the sender immediately and permanently delete this email with any files that may be attached.
Message body is not shown because sender requested not to inline it.