Revision d8619496
Added by Bernhard Suttner about 3 years ago
app/services/ipam/random_db.rb | ||
---|---|---|
break if iterations >= MAX_ITERATIONS
|
||
# try to match it
|
||
ip = candidate.to_s
|
||
if !excluded_ips.include?(ip) && !subnet.known_ips.include?(ip)
|
||
logger.debug("Found #{ip} in #{iterations} iterations")
|
||
if !excluded_ips.include?(ip) && !subnet.known_ips.include?(ip) && !is_ip_blocked?(ip)
|
||
logger.debug("Found IP #{ip} in #{iterations} iterations, blocking it for the next #{block_ip_minutes} minutes")
|
||
block_ip(ip)
|
||
return ip
|
||
end
|
||
end
|
Also available in: Unified diff
Fixes #32252 - block ip during host creation
Block the IP during host host creation if IPAM internal db or random db is used.
The block ip mechanism is not used for DHCP IPAM because the IP
reservation is done on the smart proxy side.