]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/INotify.pm
INotify: allow vlan tagged bridge interface on non-vlanaware bridge
[pve-common.git] / src / PVE / INotify.pm
index 22f413b77ba3313e9cf9828ca8a1e5ce519ab45d..1a528fa356bc0f7207dfeb4f816487ca596b7d4e 100644 (file)
@@ -901,6 +901,7 @@ sub __read_etc_network_interfaces {
     SECTION: while (defined ($line = <$fh>)) {
        chomp ($line);
        next if $line =~ m/^\s*#/;
+       next if $line =~ m/^\s*(allow-hotplug)\s+(.*)$/;
 
        if ($line =~ m/^\s*(auto|allow-ovs)\s+(.*)$/) {
            my @aa = split (/\s+/, $2);
@@ -1473,9 +1474,7 @@ sub __write_etc_network_interfaces {
            die "vlan '$iface' - unable to find parent '$p'\n"
                if !$n;
 
-           if ($n->{type} eq 'bridge' && !$n->{bridge_vlan_aware}) {
-               die "vlan '$iface' - bridge vlan aware is not enabled on parent '$p'\n";
-           } elsif ($n->{type} ne 'eth' && $n->{type} ne 'bridge' && $n->{type} ne 'bond' && $n->{type} ne 'vlan') {
+           if ($n->{type} ne 'eth' && $n->{type} ne 'bridge' && $n->{type} ne 'bond' && $n->{type} ne 'vlan') {
                die "vlan '$iface' - wrong interface type on parent '$p' " .
                    "('$n->{type}' != 'eth|bond|bridge|vlan' )\n";
            }
@@ -1511,6 +1510,10 @@ sub __write_etc_network_interfaces {
                my $n = $ifaces->{$p};
                die "bridge '$iface' - unable to find bridge port '$p'\n"
                    if !$n;
+               die "iface $p - ip address can't be set on interface if bridged in $iface\n" 
+                   if ($n->{method} eq 'static' && $n->{address} ne '0.0.0.0') || 
+                       ($n->{method6} eq 'static' && $n->{address} ne "\:\:");
+
                &$check_mtu($ifaces, $iface, $p);
                $bridgeports->{$p} = $iface;
            }