X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=src%2FPVE%2FINotify.pm;h=cf6ef57ab6608baf4506a571143e2fa774203c13;hb=e65624a3fac59893e6838d707d38efe8bb875ccb;hp=f524672e6cfd6827ceea891bffa44bd0f2996344;hpb=8342b610eab52ede9833fe2b3663313a93e53cc5;p=pve-common.git diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm index f524672..cf6ef57 100644 --- a/src/PVE/INotify.pm +++ b/src/PVE/INotify.pm @@ -1500,21 +1500,21 @@ sub __write_etc_network_interfaces { # check bond foreach my $iface (keys %$ifaces) { my $d = $ifaces->{$iface}; - if ($d->{type} eq 'bond' && $d->{slaves}) { - my $bond_primary_is_slave = undef; - foreach my $p (split (/\s+/, $d->{slaves})) { - my $n = $ifaces->{$p}; - $n->{autostart} = 1; + next if !($d->{type} eq 'bond' && $d->{slaves}); - die "bond '$iface' - unable to find slave '$p'\n" - if !$n; - die "bond '$iface' - wrong interface type on slave '$p' " . - "('$n->{type}' != 'eth')\n" if $n->{type} ne 'eth'; - &$check_mtu($ifaces, $iface, $p); - $bond_primary_is_slave = 1 if $d->{'bond-primary'} && $d->{'bond-primary'} eq $p; - } - die "bond '$iface' - bond-primary interface is not a slave" if $d->{'bond-primary'} && !$bond_primary_is_slave; + my $bond_primary_is_slave = undef; + foreach my $p (split (/\s+/, $d->{slaves})) { + my $n = $ifaces->{$p}; + $n->{autostart} = 1; + + die "bond '$iface' - unable to find slave '$p'\n" if !$n; + die "bond '$iface' - wrong interface type on slave '$p' ('$n->{type}' != 'eth or bond')\n" + if ($n->{type} ne 'eth' && $n->{type} ne 'bond'); + + $check_mtu->($ifaces, $iface, $p); + $bond_primary_is_slave = 1 if $d->{'bond-primary'} && $d->{'bond-primary'} eq $p; } + die "bond '$iface' - bond-primary interface is not a slave" if $d->{'bond-primary'} && !$bond_primary_is_slave; } # check vxlan @@ -1674,12 +1674,10 @@ NETWORKDOC my ($rootiface, @rest) = split(/[.:]/, $iface); my $childlevel = scalar(@rest); - my $n = $ifaces->{$rootiface}; - - my $pri = $if_type_hash->{$n->{type}} + $childlevel - if $n->{type} && $n->{type} ne 'unknown'; + my $type = $ifaces->{$rootiface}->{type}; + return if !$type || $type eq 'unknown'; - return $pri; + return $if_type_hash->{$type} + $childlevel }; foreach my $iface (sort {