[net-dns-users] Can't call method "zclass" on an undefined value at ... Net/DNS/Packet.pm line 474

Dick Franks rwfranks at acm.org
Thu Jun 25 19:46:58 UTC 2015


Thanks Duane, that is very helpful.

Please file RT#bug, so we can address it before next release, which has
been "next week" for several weeks!


Dick
________________________


On 25 June 2015 at 19:37, Wessels, Duane <dwessels at verisign.com> wrote:

> An issue was reported to the fpdns repository:
>
>   https://github.com/kirei/fpdns/issues/8
>
> I traced through the code, found what fpdns is doing and replicated it in
> the small program below.
>
>   1 #!/usr/bin/perl
>   2 use strict;
>   3 use warnings;
>   4 use Net::DNS::Packet;
>   5
>   6 my $packet = new Net::DNS::Packet;
>   7 my $q  = new Net::DNS::Question('.', 'IN', 'A');
>   8
>   9 $packet->header->opcode('UPDATE');
>  10 $packet->push('question', $q);
>
>
> Essentially, it seems when a packet header has opcode set to UPDATE, the
> push method fails
> because it expects the question (aka 'zone') section to be non-empty:
>
> 468 sub push {
> 469         my $self = shift;
> 470         my $list = $self->_section(shift);
> 471         my @rr   = grep ref($_), @_;
> 472
> 473         if ( $self->header->opcode eq 'UPDATE' ) {
> 474                 my $zclass = ( $self->zone )[0]->zclass;
> 475                 foreach (@rr) {
> 476                         $_->class($zclass) unless $_->class =~
> /ANY|NONE/;
> 477                 }
> 478         }
> 479
> 480         return CORE::push( @$list, @rr );
> 481 }
>
> I'm not sure, but this seems like a bug net Net::DNS.  If so I'll be happy
> to file the bug report...
>
> DW
>
>
> _______________________________________________
> net-dns-users mailing list
> net-dns-users at nlnetlabs.nl
> https://www.nlnetlabs.nl/mailman/listinfo/net-dns-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nlnetlabs.nl/pipermail/net-dns-users/attachments/20150625/901c197a/attachment.htm>


More information about the net-dns-users mailing list