mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-10-04 21:14:21 +00:00
net devs: code cleanup new fdb mac add helper
reduce a level of indentation and modernize slightly Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
21947fea42
commit
1b5ba4ddc6
@ -8316,19 +8316,18 @@ sub check_volume_storage_type {
|
|||||||
sub add_nets_bridge_fdb {
|
sub add_nets_bridge_fdb {
|
||||||
my ($conf, $vmid) = @_;
|
my ($conf, $vmid) = @_;
|
||||||
|
|
||||||
foreach my $opt (keys %$conf) {
|
for my $opt (keys %$conf) {
|
||||||
if ($opt =~ m/^net(\d+)$/) {
|
next if $opt !~ m/^net(\d+)$/;
|
||||||
my $net = parse_net($conf->{$opt});
|
my $iface = "tap${vmid}i$1";
|
||||||
next if !$net;
|
my $net = parse_net($conf->{$opt}) or next;
|
||||||
next if !$net->{macaddr};
|
my $mac = $net->{macaddr} or next;
|
||||||
|
|
||||||
my $iface = "tap${vmid}i$1";
|
if ($have_sdn) {
|
||||||
if ($have_sdn) {
|
PVE::Network::SDN::Zones::add_bridge_fdb($iface, $mac, $net->{bridge}, $net->{firewall});
|
||||||
PVE::Network::SDN::Zones::add_bridge_fdb($iface, $net->{macaddr}, $net->{bridge}, $net->{firewall});
|
} else {
|
||||||
} else {
|
PVE::Network::add_bridge_fdb($iface, $mac, $net->{firewall});
|
||||||
PVE::Network::add_bridge_fdb($iface, $net->{macaddr}, $net->{firewall});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user