]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/Network.pm
tools: add fchownat syscall
[pve-common.git] / src / PVE / Network.pm
index 342153233bd580442f1a2a695e4b6f21a7a56ab7..b1564e829613eff9525e17ffc7fa9aa4905a7097 100644 (file)
@@ -291,7 +291,7 @@ sub veth_create {
 
     # create veth pair
     if (! -d "/sys/class/net/$veth") {
-       my $cmd = "/sbin/ip link add name $veth type veth peer name $vethpeer mtu $bridgemtu";
+       my $cmd = "/sbin/ip link add name $veth mtu $bridgemtu type veth peer name $vethpeer mtu $bridgemtu";
        $cmd .= " addr $mac" if $mac;
        system($cmd) == 0 || die "can't create interface $veth\n";
     }
@@ -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;
        }
     };