Subject: | inconsistent handling of qname with special chars (wire presentation or not) |
sometimes the wire presentation is used, sometimes the text
presentation, depending if the packet was created from data or not:
use Net::DNS;
use strict;
my $pkt1 = Net::DNS::Packet->new( "spa ce","A","IN" );
my $pkt2 = Net::DNS::Packet->new( \$pkt1->data );
warn "pkt1.q.qname='".($pkt1->question)[0]->qname."'\n";
warn "pkt2.q.qname='".($pkt2->question)[0]->qname."'\n";
----
gives:
pkt1.q.qname='spa ce'
pkt2.q.qname='spa\032ce'
This was found when using the SPF test suite which uses DNS names with
spaces to check implementation
BTW, I cannot find any documentation that not the raw data (wire
presentation) are given, about the kind of text presentation used
and I find it strange that in the text presentation \032 means
chr(32) and not chr(oct(32)) like one would expect from perl strings