Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: kimminh.kaplan [...] nic.fr
Cc:
AdminCc:

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



CC: sie [...] nic.fr
Subject: [PATCH] Fix compression of domain names in big packets
Date: Fri, 28 Nov 2008 16:23:22 +0000
To: bug-Net-DNS [...] rt.cpan.org
From: Kim Minh Kaplan <kimminh.kaplan [...] nic.fr>
When compressing domain names the offset must fit in 14 bits. When it does not, compression should not be performed. This is happens to us when composing dynamic update packets larger than around 250 domains. The attached patch fixes this. Kim Minh.
Index: t/04-packet.t =================================================================== --- t/04-packet.t (révision 728) +++ t/04-packet.t (copie de travail) @@ -89,6 +89,13 @@ is($count2, 2, "push() returns $section RR count"); } +# Add enough distinct labels to render compression unusable at some point +for (0..255) { + $update->push('answer', + Net::DNS::RR->new("X$_ TXT \"" . pack("A255", "x").'"')); +} +$update->push('answer', Net::DNS::RR->new('XY TXT ""')); +$update->push('answer', Net::DNS::RR->new('VW.XY TXT ""')); # Parse data and compare with original my $buffer = $update->data; Index: lib/Net/DNS/Packet.pm =================================================================== --- lib/Net/DNS/Packet.pm (révision 728) +++ lib/Net/DNS/Packet.pm (copie de travail) @@ -542,7 +542,7 @@ $compname .= pack('n', 0xc000 | $pointer); last; } - $namehash->{$dname} = $offset; + $namehash->{$dname} = $offset if ($offset < 0x4000); my $label = shift @names; my $length = length $label || next; # skip if null
Thanks, this lives in the next release which is forthcoming. -Olaf