Subject: | answerfrom/size not set in bgread |
Date: | Sat, 9 Sep 2006 10:03:41 +1000 |
To: | bug-Net-DNS [...] rt.cpan.org |
From: | Danny Thomas <d.thomas [...] its.uq.edu.au> |
I'm scanning our network for name-servers, some of which are running on
firewalls and are bound to several interfaces leading to things like
dig @130.102.67.254 168.192.in-addr.arpa soa
;; reply from unexpected source: 130.102.1.163#53, expected 130.102.67.254#53
;; reply from unexpected source: 130.102.1.163#53, expected 130.102.67.254#53
my script uses bgsend to send the same query to each address in a /24,
however I noticed $sender was undefined:
my $ans = $res->bgread($sock);
my $sender = $ans->answerfrom;
things worked upon adding two lines to Net::DNS::Resolver::Base.pm,
the last two in this fragment from bgread()
my ($ans, $err) = Net::DNS::Packet->new(\$buf, $self->{'debug'});
if (defined $ans) {
$self->errorstring($ans->header->rcode);
$ans->{'answerfrom'} = $sock->peerhost;
$ans->{'answersize'} = length($buf);
I have not checked to see whether any other values need setting
to match what happens in the synchronous $res->query() method.
cheers,
Danny
I'm using Net::DNS 0.53_02 under perl-5.8.5 on FreeBSD-4.11-p12,
but there's no change to bgread under Net::DNS 0.58
--
d.thomas@its.uq.edu.au Danny Thomas,
+61-7-3365-8221 Software Infrastructure,
http://www.its.uq.edu.au ITS, The University of Queensland