]> git.proxmox.com Git - pve-common.git/commitdiff
fix #2303: detect IPs of p2p interfaces
authorStefan Reiter <s.reiter@proxmox.com>
Mon, 29 Jul 2019 09:27:16 +0000 (11:27 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 29 Jul 2019 14:23:13 +0000 (16:23 +0200)
"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>
(cherry picked from commit 5c1556cd27c93705eef1d02f2d09e0c245212e67)

src/PVE/Network.pm

index 8dfc9c2fd063de88defd70b05c85635c6ed02333..b1564e829613eff9525e17ffc7fa9aa4905a7097 100644 (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;
        }
     };