Hi Alex,
This might help you figure it out. I added the following puts statements at the top of the initialize function in code_mapper.rb:
def initialize(arg) #:nodoc: all
if self.class == Dnsruby::Classes
STDOUT.puts "arg: #{arg}"
STDOUT.puts @@arrays[self.class].inspect
end
The output below shows what is printed at the time that qclass seems to go bad. You'll notice that in the @values hash, the value of 1 has changed from "IN" to "1". I hope this helps you pinpoint the problem.
#<Dnsruby::Message:0x007faa10461e98 @header=#<Dnsruby::Header:0x007faa10461da8 @id=40207, @qr=false, @opcode=Query, @aa=false, @ad=false, @tc=false, @rd=false, @ra=false, @cd=false, @rcode=NOERROR, @qdcount=1, @nscount=0, @ancount=0, @arcount=0>, @question=[#<Dnsruby::Question:0x007faa1045b4a8 @qtype=A,
@qclass=IN, @qname=#<Dnsruby::Name:
google.com.>>], @answer=[], @authority=[], @additional=[], @tsigstate=:Unsigned, @signing=false, @tsigkey=nil, @answerfrom=nil, @answerip=nil, @send_raw=false, @do_validation=true, @do_caching=true, @security_level=UNCHECKED, @security_error=nil, @cached=false>
overriding qclass to IN
arg: IN
#<Dnsruby::CodeMapper::Arrays:0x007faa104a6fc0 @strings={"IN"=>1, "CH"=>3, "HS"=>4, "NONE"=>254, "ANY"=>255, "CLASS512"=>512, "0"=>0, "CLASS4096"=>4096, "7"=>7, "CLASS56321"=>56321, "CLASS164"=>164}, @stringsdown={"in"=>1, "ch"=>3, "hs"=>4, "none"=>254, "any"=>255, "class512"=>512, "0"=>0, "class4096"=>4096, "7"=>7, "class56321"=>56321, "class164"=>164}, @values={
1=>"IN", 3=>"CH", 4=>"HS", 254=>"NONE", 255=>"ANY", 512=>"CLASS512", 0=>"0", 4096=>"CLASS4096", 7=>"7", 56321=>"CLASS56321", 164=>"CLASS164"}, @maxcode=197>
#<Dnsruby::Message:0x007faa10461e98 @header=#<Dnsruby::Header:0x007faa10461da8 @id=40207, @qr=false, @opcode=Query, @aa=false, @ad=false, @tc=false, @rd=false, @ra=false, @cd=false, @rcode=NOERROR, @qdcount=1, @nscount=0, @ancount=0, @arcount=0>, @question=[#<Dnsruby::Question:0x007faa1045b4a8 @qtype=A,
@qclass=IN, @qname=#<Dnsruby::Name:
google.com.>>], @answer=[], @authority=[], @additional=[], @tsigstate=:Unsigned, @signing=false, @tsigkey=nil, @answerfrom=nil, @answerip=nil, @send_raw=false, @do_validation=true, @do_caching=true, @security_level=UNCHECKED, @security_error=nil, @cached=false>
arg: 512
#<Dnsruby::CodeMapper::Arrays:0x007faa104a6fc0 @strings={"IN"=>1, "CH"=>3, "HS"=>4, "NONE"=>254, "ANY"=>255, "CLASS512"=>512, "0"=>0, "CLASS4096"=>4096, "7"=>7, "CLASS56321"=>56321, "CLASS164"=>164}, @stringsdown={"in"=>1, "ch"=>3, "hs"=>4, "none"=>254, "any"=>255, "class512"=>512, "0"=>0, "class4096"=>4096, "7"=>7, "class56321"=>56321, "class164"=>164}, @values={1=>"IN", 3=>"CH", 4=>"HS", 254=>"NONE", 255=>"ANY", 512=>"CLASS512", 0=>"0", 4096=>"CLASS4096", 7=>"7", 56321=>"CLASS56321", 164=>"CLASS164"}, @maxcode=197>
arg: CLASS512
#<Dnsruby::CodeMapper::Arrays:0x007faa104a6fc0 @strings={"IN"=>1, "CH"=>3, "HS"=>4, "NONE"=>254, "ANY"=>255, "CLASS512"=>512, "0"=>0, "CLASS4096"=>4096, "7"=>7, "CLASS56321"=>56321, "CLASS164"=>164}, @stringsdown={"in"=>1, "ch"=>3, "hs"=>4, "none"=>254, "any"=>255, "class512"=>512, "0"=>0, "class4096"=>4096, "7"=>7, "class56321"=>56321, "class164"=>164}, @values={1=>"IN", 3=>"CH", 4=>"HS", 254=>"NONE", 255=>"ANY", 512=>"CLASS512", 0=>"0", 4096=>"CLASS4096", 7=>"7", 56321=>"CLASS56321", 164=>"CLASS164"}, @maxcode=197>
arg: 1
#<Dnsruby::CodeMapper::Arrays:0x007faa104a6fc0 @strings={"IN"=>1, "CH"=>3, "HS"=>4, "NONE"=>254, "ANY"=>255, "CLASS512"=>512, "0"=>0, "CLASS4096"=>4096, "7"=>7, "CLASS56321"=>56321, "CLASS164"=>164}, @stringsdown={"in"=>1, "ch"=>3, "hs"=>4, "none"=>254, "any"=>255, "class512"=>512, "0"=>0, "class4096"=>4096, "7"=>7, "class56321"=>56321, "class164"=>164}, @values={1=>"IN", 3=>"CH", 4=>"HS", 254=>"NONE", 255=>"ANY", 512=>"CLASS512", 0=>"0", 4096=>"CLASS4096", 7=>"7", 56321=>"CLASS56321", 164=>"CLASS164"}, @maxcode=198>
arg: IN
#<Dnsruby::CodeMapper::Arrays:0x007faa104a6fc0 @strings={"IN"=>1, "CH"=>3, "HS"=>4, "NONE"=>254, "ANY"=>255, "CLASS512"=>512, "0"=>0, "CLASS4096"=>4096, "7"=>7, "CLASS56321"=>56321, "CLASS164"=>164}, @stringsdown={"in"=>1, "ch"=>3, "hs"=>4, "none"=>254, "any"=>255, "class512"=>512, "0"=>0, "class4096"=>4096, "7"=>7, "class56321"=>56321, "class164"=>164}, @values={1=>"IN", 3=>"CH", 4=>"HS", 254=>"NONE", 255=>"ANY", 512=>"CLASS512", 0=>"0", 4096=>"CLASS4096", 7=>"7", 56321=>"CLASS56321", 164=>"CLASS164"}, @maxcode=198>
arg: 4096
#<Dnsruby::CodeMapper::Arrays:0x007faa104a6fc0 @strings={"IN"=>1, "CH"=>3, "HS"=>4, "NONE"=>254, "ANY"=>255, "CLASS512"=>512, "0"=>0, "CLASS4096"=>4096, "7"=>7, "CLASS56321"=>56321, "CLASS164"=>164}, @stringsdown={"in"=>1, "ch"=>3, "hs"=>4, "none"=>254, "any"=>255, "class512"=>512, "0"=>0, "class4096"=>4096, "7"=>7, "class56321"=>56321, "class164"=>164}, @values={1=>"IN", 3=>"CH", 4=>"HS", 254=>"NONE", 255=>"ANY", 512=>"CLASS512", 0=>"0", 4096=>"CLASS4096", 7=>"7", 56321=>"CLASS56321", 164=>"CLASS164"}, @maxcode=198>
arg: 0
#<Dnsruby::CodeMapper::Arrays:0x007faa104a6fc0 @strings={"IN"=>1, "CH"=>3, "HS"=>4, "NONE"=>254, "ANY"=>255, "CLASS512"=>512, "0"=>0, "CLASS4096"=>4096, "7"=>7, "CLASS56321"=>56321, "CLASS164"=>164}, @stringsdown={"in"=>1, "ch"=>3, "hs"=>4, "none"=>254, "any"=>255, "class512"=>512, "0"=>0, "class4096"=>4096, "7"=>7, "class56321"=>56321, "class164"=>164}, @values={1=>"IN", 3=>"CH", 4=>"HS", 254=>"NONE", 255=>"ANY", 512=>"CLASS512", 0=>"0", 4096=>"CLASS4096", 7=>"7", 56321=>"CLASS56321", 164=>"CLASS164"}, @maxcode=198>
arg: IN
#<Dnsruby::CodeMapper::Arrays:0x007faa104a6fc0 @strings={"IN"=>1, "CH"=>3, "HS"=>4, "NONE"=>254, "ANY"=>255, "CLASS512"=>512, "0"=>0, "CLASS4096"=>4096, "7"=>7, "CLASS56321"=>56321, "CLASS164"=>164, "1"=>1}, @stringsdown={"in"=>1, "ch"=>3, "hs"=>4, "none"=>254, "any"=>255, "class512"=>512, "0"=>0, "class4096"=>4096, "7"=>7, "class56321"=>56321, "class164"=>164, "1"=>1}, @values={
1=>"1", 3=>"CH", 4=>"HS", 254=>"NONE", 255=>"ANY", 512=>"CLASS512", 0=>"0", 4096=>"CLASS4096", 7=>"7", 56321=>"CLASS56321", 164=>"CLASS164"}, @maxcode=213>
arg: 1
#<Dnsruby::CodeMapper::Arrays:0x007faa104a6fc0 @strings={"IN"=>1, "CH"=>3, "HS"=>4, "NONE"=>254, "ANY"=>255, "CLASS512"=>512, "0"=>0, "CLASS4096"=>4096, "7"=>7, "CLASS56321"=>56321, "CLASS164"=>164, "1"=>1}, @stringsdown={"in"=>1, "ch"=>3, "hs"=>4, "none"=>254, "any"=>255, "class512"=>512, "0"=>0, "class4096"=>4096, "7"=>7, "class56321"=>56321, "class164"=>164, "1"=>1}, @values={1=>"1", 3=>"CH", 4=>"HS", 254=>"NONE", 255=>"ANY", 512=>"CLASS512", 0=>"0", 4096=>"CLASS4096", 7=>"7", 56321=>"CLASS56321", 164=>"CLASS164"}, @maxcode=213>
#<Dnsruby::Message:0x007faa104172d0 @header=#<Dnsruby::Header:0x007faa10417168 @id=62426, @qr=false, @opcode=Query, @aa=false, @ad=false, @tc=false, @rd=false, @ra=false, @cd=false, @rcode=NOERROR, @qdcount=1, @nscount=0, @ancount=0, @arcount=0>, @question=[#<Dnsruby::Question:0x007faa10415098 @qtype=A,
@qclass=1, @qname=#<Dnsruby::Name:
google.com.>>], @answer=[], @authority=[], @additional=[], @tsigstate=:Unsigned, @signing=false, @tsigkey=nil, @answerfrom=nil, @answerip=nil, @send_raw=false, @do_validation=true, @do_caching=true, @security_level=UNCHECKED, @security_error=nil, @cached=false>
overriding qclass to IN
arg: IN
#<Dnsruby::CodeMapper::Arrays:0x007faa104a6fc0 @strings={"IN"=>1, "CH"=>3, "HS"=>4, "NONE"=>254, "ANY"=>255, "CLASS512"=>512, "0"=>0, "CLASS4096"=>4096, "7"=>7, "CLASS56321"=>56321, "CLASS164"=>164, "1"=>1}, @stringsdown={"in"=>1, "ch"=>3, "hs"=>4, "none"=>254, "any"=>255, "class512"=>512, "0"=>0, "class4096"=>4096, "7"=>7, "class56321"=>56321, "class164"=>164, "1"=>1}, @values={1=>"1", 3=>"CH", 4=>"HS", 254=>"NONE", 255=>"ANY", 512=>"CLASS512", 0=>"0", 4096=>"CLASS4096", 7=>"7", 56321=>"CLASS56321", 164=>"CLASS164"}, @maxcode=213>
#<Dnsruby::Message:0x007faa104172d0 @header=#<Dnsruby::Header:0x007faa10417168 @id=62426, @qr=false, @opcode=Query, @aa=false, @ad=false, @tc=false, @rd=false, @ra=false, @cd=false, @rcode=NOERROR, @qdcount=1, @nscount=0, @ancount=0, @arcount=0>, @question=[#<Dnsruby::Question:0x007faa10415098 @qtype=A,
@qclass=1, @qname=#<Dnsruby::Name:
google.com.>>], @answer=[], @authority=[], @additional=[], @tsigstate=:Unsigned, @signing=false, @tsigkey=nil, @answerfrom=nil, @answerip=nil, @send_raw=false, @do_validation=true, @do_caching=true, @security_level=UNCHECKED, @security_error=nil, @cached=false>
Thanks,