Skip to content

Commit

Permalink
f-93: fix check excluded IP is in range
Browse files Browse the repository at this point in the history
Signed-off-by: Aleix Ramírez <aramirez@opennebula.io>
  • Loading branch information
aleixrm committed Nov 29, 2024
1 parent 4f74bcf commit 367f499
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,10 @@ func setupRange(args ...string) (handler.Handler4, error) {
}
//check if excluded IPs are in the range and pre-allocate them
for _, excluded := range p.ExcludedIPs {
p.checkIPInRange(excluded)
if !p.checkIPInRange(excluded) {
log.Warnf("excluded IP %v is not in the range, not preallocation needed.", excluded)
continue
}
if _, err := p.allocator.Allocate(net.IPNet{IP: excluded}); err != nil {
return nil, fmt.Errorf("could not pre-allocate excluded IP %v: %w", excluded, err)
}
Expand Down

0 comments on commit 367f499

Please sign in to comment.