Issue #11632 has been reported by Hannes Georg.

----------------------------------------
Bug #11632: Resolv::DNS::Message.encode fails to encode messages larger than 16383 byte
https://bugs.ruby-lang.org/issues/11632

* Author: Hannes Georg
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: 
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Hello Rubyists

The ruby dns message encoder automatically remembers _all_ label addresses to be reused later ( see https://github.com/ruby/ruby/blob/v2_2_3/lib/resolv.rb#L1470 ). The address field however is limited to 14 bits ( see https://tools.ietf.org/html/rfc1035#section-4.1.4 ). If the message gets larger than 16383 bytes the addresses of new labels won't fit anymore. The encoder takes this into account and truncates the addresses on write which makes them invalid ( see https://github.com/ruby/ruby/blob/v2_2_3/lib/resolv.rb#L1467 ).

My suggested solution is to not store addresses larger than 16383. Is a github pr okay for that?



-- 
https://bugs.ruby-lang.org/