OK it's not-a-bug. :tada: The behaviour of this co...
# openvox
i
OK it's not-a-bug. 🎉 The behaviour of this code has changed between ruby 2.7 and 3.2
Copy code
#!/opt/puppetlabs/puppet/bin/ruby
# frozen_string_literal: true
require 'ipaddr'
class IPIterator < IPAddr
  def succ
    mask_size = if prefix <= 8
                  24
                elsif prefix <= 16
                  16
                elsif prefix <= 24
                  8
                else
                  1
                end
    clone.set(@addr + (2**mask_size), @family)
  end
end

IPIterator.new('172.16.0.0/12').to_range.map do |value|
  puts "#{value}"
end
The number of iterations has gone from 16 -> 524,288 There's another call to
10.0.0.0/8
too, which would iterate something like 16M times I guess. 😬
ohmy 1