Project

General

Profile

Actions

Bug #10520

closed

Resolv fails on additional resources when quering address records

Added by corny (Mr Corn) about 10 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.1.5p273
[ruby-core:66327]

Description

This works:

Resolv::DNS.open(nameserver: ['8.8.8.8'] ) { |dns| dns.getresources('wikileaks.org', Resolv::DNS::Resource::IN::A) }

This fails:

Resolv::DNS.open(nameserver: ['217.219.179.10'] ) { |dns| dns.getresources('wikileaks.org', Resolv::DNS::Resource::IN::A) }
ArgumentError: IPv4 address expects 4 bytes but 2 bytes
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:2332:in `initialize'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:2137:in `new'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:2137:in `decode_rdata'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:1621:in `block in get_rr'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:1522:in `get_length16'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:1621:in `get_rr'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:1499:in `block (2 levels) in decode'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:1498:in `each'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:1498:in `block in decode'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:1511:in `initialize'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:1475:in `new'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:1475:in `decode'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:699:in `request'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:529:in `block in fetch_resource'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:1096:in `block (3 levels) in resolv'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:1094:in `each'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:1094:in `block (2 levels) in resolv'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:1093:in `each'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:1093:in `block in resolv'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:1091:in `each'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:1091:in `resolv'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:520:in `fetch_resource'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:510:in `each_resource'
  from $HOME/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/resolv.rb:501:in `getresources'

I found out that 217.219.179.10 returns additional resources Resolv can not handle. You can test it with:

dig @8.8.8.8 wikileaks.org
dig @217.219.179.10 wikileaks.org

I have attached a pcap file with both queries and responses.


Files

queries.pcap (991 Bytes) queries.pcap corny (Mr Corn), 11/16/2014 04:53 PM
Actions

Also available in: Atom PDF

Like0
Like0