]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/Network.pm
schema: add bwlimit standard option and format
[pve-common.git] / src / PVE / Network.pm
index babc2049844e059d5cc9e50ff8b515cf1ae1413a..de8b2897d6c340d4f33c6d46c008667282da956d 100644 (file)
@@ -14,6 +14,8 @@ use Net::IP;
 
 # host network related utility functions
 
+our $PHYSICAL_NIC_RE = qr/(?:eth\d+|en[^:.]+|ib\d+)/;
+
 our $ipv4_reverse_mask = [
     '0.0.0.0',
     '128.0.0.0',
@@ -100,7 +102,7 @@ sub setup_tc_rate_limit {
     run_command("/sbin/tc filter add dev $iface parent ffff: " .
                "prio 50 basic " .
                "police rate ${rate}bps burst ${burst}b mtu 64kb " .
-               "drop flowid :1");
+               "drop");
 
     if ($debug) {
        print "DEBUG tc settings\n";
@@ -595,12 +597,12 @@ sub get_ip_from_hostname {
        $ip = addr_to_ip($res[0]->{addr})
     };
     if ($@) {
-       die "hostname lookup failed:\n$@" if !$noerr;
+       die "hostname lookup '$hostname' failed - $@" if !$noerr;
        return undef;
     }
 
     if ($ip =~ m/^127\.|^::1$/) {
-       die "hostname lookup failed - got local IP address ($hostname = $ip)\n" if !$noerr;
+       die "hostname lookup '$hostname' failed - got local IP address '$ip'\n" if !$noerr;
        return undef;
     }