[net-dns-users] Severe Net::DNS bug waiting to be fixed

Dick Franks rwfranks at acm.org
Thu Jul 18 14:29:12 UTC 2013


That is good.
I do like the idea of the dummy header.

Please can you put that on trunk so we can persuade it to test clean using
Net::DNS::SEC 0.16


Dick Franks

--


On 18 July 2013 13:14, Willem Toorop <willem at nlnetlabs.nl> wrote:

> Thanks. To make tests succeed with Net::DNS::SEC 0.16, I also had to put
> in a dummy header into Packet:
>
> --- Packet.pm   2013-07-18 13:39:10.870079091 +0200
> +++ Packet.pm   2013-07-18 13:41:42.598078205 +0200
> @@ -67,6 +67,7 @@
>                 additional => []}, $class;
>
>         $self->{question} = [Net::DNS::Question->new(@_)] if scalar @_;
> +       $self->{header} = {}; # Backw. compatibility with Net::DNS::SEC
>
>         $self->header->rd(1);
>         return $self;
> @@ -126,7 +127,8 @@
>                         answer     => [],
>                         authority  => [],
>                         additional => [],
> -                       answersize => length $$data
> +                       answersize => length $$data,
> +                       header     => {} # BW compat. with Net::DNS::SEC
>                         }, $class;
>
>                 # question/zone section
>
> I also added some more default initializations for status:
>
> --- Header.pm.orig      2013-07-18 14:07:07.778069322 +0200
> +++ Header.pm   2013-07-18 13:54:13.878073831 +0200
> @@ -139,7 +139,7 @@
>  sub opcode {
>         my $self = shift;
>         my $xpkt = $self->{xbody};
> -       for ( $xpkt->{status} ) {
> +       for ( $xpkt->{status} ||= 0 ) {
>                 return opcodebyval(( $_ >> 11) & 0x0f) unless scalar @_;
>                 my $opcode = opcodebyname(shift);
>                 $_ = ( $_ & 0x87ff ) | ( $opcode << 11 );
> @@ -160,7 +160,7 @@
>  sub rcode {
>         my $self = shift;
>         my $xpkt = $self->{xbody};
> -       for ( $xpkt->{status} ) {
> +       for ( $xpkt->{status} ||= 0 ) {
>                 my $arg = shift;
>                 my $opt = $self->edns;
>                 unless ( defined $arg ) {
>
> Do you agree?
>
> -- Willem
>
> Op 18-07-13 12:59, Dick Franks schreef:
> > Willem,
> >
> > Attached tarball patches Header and Packet to solve memory leak.
> > I am still looking at the implications for Net::DNS::SEC
> >
> > Dick Franks
>
> _______________________________________________
> 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/20130718/477e2c8a/attachment.htm>


More information about the net-dns-users mailing list