Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: MSTPLBG [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.66
Fixed in: (no value)



Subject: Net::DNS::Nameserver: NotifyHandler required but not documented
Hi, the documentation says that for a Net::DNS::Nameserver, only the ReplyHandler is required. However, when not specifying a NotifyHandler, I get the following error at runtime whenever somebody sends the nameserver a notify packet: Can't use string ("") as a subroutine ref while "strict refs" in use at /usr/lib/perl5/Net/DNS/Nameserver.pm line 196. This is obvious due to the code, which unconditionally calls the NotifyHandler coderef: if ($query->header->opcode eq "QUERY"){ ($rcode, $ans, $auth, $add, $headermask) = &{$self->{"ReplyHandler"}}($qname, $qclass, $qtype, $peerhost, $query, $conn); }else{ $reply->header->rcode("SERVFAIL") unless ( ref $self->{"NotifyHandler"} eq "CODE"); ($rcode, $ans, $auth, $add, $headermask) = &{$self->{"NotifyHandler"}}($qname, $qclass, $qtype, $peerhost, $query, $conn); } So, either the code needs to be changed to not call the coderef if it’s not set, or the documentation needs to be updated :-). Best regards, Michael
Hi Michael, This was fixed 5 January 2011 in the context of RT ticket 63321. The fix is in a public release since version 0.67 which was release 4 November 2011. Thanks for reporting anyway, -- Willem On Wed 07 Mar 2012 10:46:15, MSTPLBG wrote: Show quoted text
> Hi, > > the documentation says that for a Net::DNS::Nameserver, only the > ReplyHandler is required. However, when not specifying a NotifyHandler, > I get the following error at runtime whenever somebody sends the > nameserver a notify packet: > > Can't use string ("") as a subroutine ref while "strict refs" in use at > /usr/lib/perl5/Net/DNS/Nameserver.pm line 196. > > This is obvious due to the code, which unconditionally calls the > NotifyHandler coderef: > > if ($query->header->opcode eq "QUERY"){ > ($rcode, $ans, $auth, $add, $headermask) = > &{$self->{"ReplyHandler"}}($qname, > $qclass, $qtype, $peerhost, $query, $conn); > }else{ > $reply->header->rcode("SERVFAIL") unless > ( ref $self->{"NotifyHandler"} eq "CODE"); > ($rcode, $ans, $auth, $add, $headermask) = > &{$self->{"NotifyHandler"}}($qname, > $qclass, $qtype, $peerhost, $query, $conn); > } > > So, either the code needs to be changed to not call the coderef if it’s > not set, or the documentation needs to be updated :-). > > Best regards, > Michael