Permalink
Browse files

Merge branch 'master' of github.com:kirei/fpdns

  • Loading branch information...
2 parents ac6ef49 + 2c174f6 commit 9eb38df6f8a3a5a53a30be13c4bb6c1e4b93b784 @wessels wessels committed May 3, 2012
Showing with 4 additions and 8 deletions.
  1. +4 −8 lib/Net/DNS/Fingerprint.pm
@@ -2160,8 +2160,7 @@ sub header2fp {
sub fp2header {
my @list = split(/,/, shift);
-
- my $header = Net::DNS::Header->new;
+ my $header = shift;
$header->qr(shift @list);
$header->opcode(shift @list);
@@ -2176,8 +2175,6 @@ sub fp2header {
$header->ancount(shift @list);
$header->nscount(shift @list);
$header->arcount(shift @list);
-
- return $header;
}
sub probe {
@@ -2188,9 +2185,8 @@ sub probe {
my $qheader = shift;
my @qstring = split(/ /, shift);
- my $header = fp2header($qheader);
-
- my $packet = Net::DNS::Packet->new(\$header->data);
+ my $packet = new Net::DNS::Packet;
+ fp2header($qheader, $packet->header);
$packet->push("question", Net::DNS::Question->new(@qstring));
if ($self->{debug}) {
@@ -2203,7 +2199,7 @@ sub probe {
my $resolver = Net::DNS::Resolver->new;
$resolver->nameservers($qserver);
if (!$ignore_recurse) {
- $resolver->recurse($header->rd);
+ $resolver->recurse($packet->header->rd);
}
$resolver->port($qport);
$resolver->srcaddr($self->{source});

0 comments on commit 9eb38df

Please sign in to comment.