- $p =~ s/\.\d+$//;
- my $n = $ifaces->{$p};
- die "bridge '$iface' - unable to find bridge port '$p'\n"
- if !$n;
- &$check_mtu($ifaces, $iface, $p);
+ if($p =~ m/(\S+)\.(\d+)$/) {
+ my $vlanparent = $1;
+ if (!defined($ifaces_copy->{$p})) {
+ $ifaces_copy->{$p}->{type} = 'vlan';
+ $ifaces_copy->{$p}->{method} = 'manual';
+ $ifaces_copy->{$p}->{method6} = 'manual';
+ $ifaces_copy->{$p}->{mtu} = $ifaces_copy->{$vlanparent}->{mtu} if defined($ifaces_copy->{$1}->{mtu});
+ }
+ }
+ my $n = $ifaces_copy->{$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} && $n->{method} eq 'static' && $n->{address} ne '0.0.0.0') ||
+ ($n->{method6} && $n->{method6} eq 'static' && $n->{address} ne '::');
+ &$check_mtu($ifaces_copy, $p, $iface);