X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=src%2FPVE%2FINotify.pm;h=f0f3144355c7d35319b9e4e2cc39f82bbbc7b29b;hp=f4a594571a49bfef69c4344bbcb0b2104919e70a;hb=c4e564708b38c9863bb946778580704e48f3b8b2;hpb=0115696f6a5671f020d544c8e432af8d7228bcdf diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm index f4a5945..f0f3144 100644 --- a/src/PVE/INotify.pm +++ b/src/PVE/INotify.pm @@ -1358,6 +1358,25 @@ sub __write_etc_network_interfaces { } } + # check vlan + foreach my $iface (keys %$ifaces) { + my $d = $ifaces->{$iface}; + if ($d->{type} eq 'vlan' && $iface =~ m/^(\S+)\.\d+$/) { + my $p = $1; + my $n = $ifaces->{$p}; + + die "vlan '$iface' - unable to find parent '$p'\n" + if $n->{exists} eq 0; + + 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') { + die "vlan '$iface' - wrong interface type on parent '$p' " . + "('$n->{type}' != 'eth|bond|bridge' )\n"; + } + } + } + # check bridgeport option my $bridgeports = {}; my $bridges = {};