.fill() returning overlapping address space
Closed this issue · 3 comments
Noticing an issue where sometimes when using .fill with v2.0.4. I see overlapping address space returned.
Example:
require 'netaddr'
supernet = NetAddr::IPv4Net.parse("1.9.0.0/19")
nets = []
["1.9.0.0/21","1.9.8.0/21","1.9.20.0/27"].each do |net|
nets.push(NetAddr::IPv4Net.parse(net))
end
puts supernet.fill(nets)
2.6.3 :012 > puts supernet.fill(nets)
1.9.0.0/21
1.9.8.0/21
1.9.16.0/20 ---> This should be a /22 and not a /20
1.9.20.0/27
1.9.20.32/27
1.9.20.64/26
1.9.20.128/25
1.9.21.0/24
1.9.22.0/23
1.9.24.0/21
=> nil
Thanks. Will have a look first chance I get.
Just a quick update. I have actually figured this one out in the go library, just not implemented here yet. The past year has not given me much opportunity for these sorts of side projects, which is why this bug has sat for so long.
Fix pushed to master. I'll iterate the gem version at some point soon as well.