X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=src%2FPVE%2FINotify.pm;fp=src%2FPVE%2FINotify.pm;h=5ff95a88d80494e33faf8a1b62afec9c71825a6b;hb=329dfb6488e5312f03c38e849ae31a950c493f65;hp=c5067de9043f557a1f2743333f645fe2c2790c28;hpb=000a5a6bcb63846f9683981c14518eda9108410f;p=pve-common.git diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm index c5067de..5ff95a8 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 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; + 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