Skip Menu |

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

Report information
The Basics
Id: 122808
Status: rejected
Priority: 0/
Queue: Net-DNS

People
Owner: Nobody in particular
Requestors: nick [...] cpanel.net
Cc:
AdminCc:

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



Subject: Net::DNS::Resolver 1.11 cannot get a reply once udppacketsize is set to 512 (PACKETSZ)
In the below example after setting udppacketsize to 512 (PACKETSZ) a response is no longer possible. #!/usr/bin/env perl # use strict; use warnings; use Net::DNS 1.11 (); use Net::DNS::Resolver (); use Test::More tests => 3; my $domain_that_requires_noedns = 'boarderhouse.ch'; # dig boarderhouse.ch @dns1.mhs.ch +noedns +short ok my $resolver = Net::DNS::Resolver->new(); $resolver->recurse(0); $resolver->usevc(0); $resolver->nameservers('213.188.32.64'); my $reply_before = $resolver->query( $domain_that_requires_noedns, 'A' ); ok( $reply_before, "Reply received when udppacketsize unset" ); $resolver->udppacketsize(0); my $reply_after_zero_packet_size = $resolver->query( $domain_that_requires_noedns, 'A' ); ok( $reply_after_zero_packet_size, "Reply received when udppacketsize set to 0" ); $resolver->udppacketsize( Net::DNS::Resolver::Base::PACKETSZ() ); my $reply_after_packetsz_packet_size = $resolver->query( $domain_that_requires_noedns, 'A' ); ok( $reply_after_packetsz_packet_size, "Reply received when udppacketsize set to PACKETSZ (512)" );
Also this is a regression from 1.08 as this code works as expected on 1.08
It appears EDNS is set in the packet when its set to 512
Subject: upload.png
Download upload.png
image/png 228.8k
upload.png
Net/DNS/RR/OPT.pm This appears to resolve the problem: -return $UDP_size < 512 ? 512 : ( $_ = $UDP_size ) unless $_; +return $UDP_size <= 512 ? 512 : ( $_ = $UDP_size ) unless $_;
From: rwfranks [...] acm.org
On Tue Aug 15 11:57:11 2017, bdraco wrote: Show quoted text
> > Net/DNS/RR/OPT.pm > > This appears to resolve the problem: > > -return $UDP_size < 512 ? 512 : ( $_ = $UDP_size ) unless $_; > +return $UDP_size <= 512 ? 512 : ( $_ = $UDP_size ) unless $_;
But it does not. It just reintroduces problem RT#122138.
From: rwfranks [...] acm.org
On Tue Aug 15 11:35:53 2017, bdraco wrote: Show quoted text
> In the below example after setting udppacketsize to 512 (PACKETSZ) a > response is no longer possible.
The size of udppacketsize is immaterial. Your nameserver returns FORMERR indicating lack of support for EDNS as required by RFC6891. $ cat RT122808.pl #!/usr/bin/perl # use Net::DNS; my $resolver = new Net::DNS::Resolver( nameserver => 'dns2.mhs.ch', udppacketsize => 1280 ); $resolver->debug(1); my $reply = $resolver->send( 'mhs.ch', 'SOA' ); __END__ $ perl RT122808.pl ;; udp send [213.188.32.64]:53 ;; answer from [213.188.32.64] 12 bytes ;; HEADER SECTION ;; id = 31776 ;; qr = 1 aa = 0 tc = 0 rd = 1 opcode = QUERY ;; ra = 0 z = 0 ad = 0 cd = 0 rcode = FORMERR ;; qdcount = 0 ancount = 0 nscount = 0 arcount = 0 ;; do = 0 ;; QUESTION SECTION (0 records) ;; ANSWER SECTION (0 records) ;; AUTHORITY SECTION (0 records) ;; ADDITIONAL SECTION (0 records) ;; errorstring: FORMERR
Hi Dick, This is mostly a problem when we change the udppacketsize to a defined value, and than want to restore the default behavior. Since udppacketsize is 0 inside the object, can we safely assume that $resolver->udppacketsize(0); will restore the default behavior and not break in the future? The current method we are using is to set it to PACKETSZ. On Tue Aug 15 11:35:53 2017, bdraco wrote: Show quoted text
> In the below example after setting udppacketsize to 512 (PACKETSZ) a > response is no longer possible. > > > #!/usr/bin/env perl > # > use strict; > use warnings; > > use Net::DNS 1.11 (); > use Net::DNS::Resolver (); > use Test::More tests => 3; > > my $domain_that_requires_noedns = 'boarderhouse.ch'; # dig > boarderhouse.ch @dns1.mhs.ch +noedns +short ok > my $resolver = Net::DNS::Resolver->new(); > > $resolver->recurse(0); > $resolver->usevc(0); > $resolver->nameservers('213.188.32.64'); > > my $reply_before = $resolver->query( $domain_that_requires_noedns, 'A' > ); > ok( $reply_before, "Reply received when udppacketsize unset" ); > > $resolver->udppacketsize(0); > > my $reply_after_zero_packet_size = $resolver->query( > $domain_that_requires_noedns, 'A' ); > ok( $reply_after_zero_packet_size, "Reply received when udppacketsize > set to 0" ); > > $resolver->udppacketsize( Net::DNS::Resolver::Base::PACKETSZ() ); > > my $reply_after_packetsz_packet_size = $resolver->query( > $domain_that_requires_noedns, 'A' ); > ok( $reply_after_packetsz_packet_size, "Reply received when > udppacketsize set to PACKETSZ (512)" );
From: rwfranks [...] acm.org
On Wed Aug 16 10:40:20 2017, bdraco wrote: Show quoted text
> Hi Dick, > > This is mostly a problem when we change the udppacketsize to a defined > value, and than want to restore the default behavior. > > Since udppacketsize is 0 inside the object, can we safely assume that > > $resolver->udppacketsize(0); > > will restore the default behavior and not break in the future? > > The current method we are using is to set it to PACKETSZ. >
udppacketsize advertises a characteristic of the local IP infrastructure, which does not change on a per-transaction basis. Your nameserver does not understand EDNS, so it is meaningless to specify the maximum size of packet it can send back to you.
Thanks. We will move forward with that solution. On Wed Aug 16 11:07:26 2017, rwfranks@acm.org wrote: Show quoted text
> On Wed Aug 16 10:40:20 2017, bdraco wrote:
> > Hi Dick, > > > > This is mostly a problem when we change the udppacketsize to a > > defined > > value, and than want to restore the default behavior. > > > > Since udppacketsize is 0 inside the object, can we safely assume that > > > > $resolver->udppacketsize(0); > > > > will restore the default behavior and not break in the future? > > > > The current method we are using is to set it to PACKETSZ. > >
> > udppacketsize advertises a characteristic of the local IP > infrastructure, which does not change on a per-transaction basis. > > Your nameserver does not understand EDNS, so it is meaningless to > specify the maximum size of packet it can send back to you.