Simplify the logic deciding when we're finished

bug/bundler_fix
James Lee 2014-01-08 14:22:44 -06:00
parent cc51c2033e
commit 4ba0020934
No known key found for this signature in database
GPG Key ID: 2D6094C7CEA0A321
1 changed files with 4 additions and 3 deletions

View File

@ -193,10 +193,11 @@ class RangeWalker
def next_ip
return false if not valid?
if (@curr_addr > @ranges[@curr_range].stop)
if (@curr_range >= @ranges.length - 1)
return nil
end
@curr_range += 1
# Are we finished?
return nil if (@curr_range >= @ranges.length)
@curr_addr = @ranges[@curr_range].start
end
addr = Rex::Socket.addr_itoa(@curr_addr, @ranges[@curr_range].ipv6?)