lib/packetgen/header/dns/rrsection.rb in packetgen-2.8.7 vs lib/packetgen/header/dns/rrsection.rb in packetgen-3.0.0
- old
+ new
@@ -23,9 +23,10 @@
# @param [String] str binary string
# @return [RRSection] self
def read(str)
clear
return self if str.nil?
+
force_binary str
while !str.empty? && (self.size < @counter.to_i)
rr = RR.new(@dns).read(str)
rr = OPT.new(@dns).read(str) if rr.type?('OPT')
str.slice!(0, rr.sz)