fix #2303: detect IPs of p2p interfaces

"ip address show" prints:

    inet ADDR peer PEERADDR/32 scope global DEVICE

for pointtopoint interfaces. We're not interested in the netmask itself,
just make the Regex match.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
Stefan Reiter 2019-07-29 11:27:16 +02:00 committed by Fabian Grünbichler
parent 8a27e4a457
commit 5c1556cd27

View File

@ -592,7 +592,7 @@ sub get_local_ip_from_cidr {
my $code = sub {
my $line = shift;
if ($line =~ m!^\s*inet(?:6)?\s+($PVE::Tools::IPRE)/\d+!) {
if ($line =~ m!^\s*inet(?:6)?\s+($PVE::Tools::IPRE)(?:/\d+|\s+peer\s+)!) {
push @$IPs, $1;
}
};