mirror of
https://git.proxmox.com/git/pve-common
synced 2025-04-28 17:07:50 +00:00
network: is_ip_in_cidr: avoid warning when versions don't match
is_ip_in_cidr('fd80:1::10', '127.0.0.1/24') would result in Use of uninitialized value in numeric eq (==) as overlaps() returns undef in such a case. Note that there are (albeit few) existing callers that don't specify $version. Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
123c310474
commit
b0e3bcc186
@ -594,6 +594,8 @@ sub is_ip_in_cidr {
|
||||
|
||||
my $overlap = $cidr_obj->overlaps($ip_obj);
|
||||
|
||||
return if !defined($overlap);
|
||||
|
||||
return $overlap == $Net::IP::IP_B_IN_A_OVERLAP || $overlap == $Net::IP::IP_IDENTICAL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user