net: Skip and warn of interfaces without bridge

Handle and warn about network interfaces which are not attached to
any bridge because the user actively removed it from the VM config.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
This commit is contained in:
Christian Ebner 2023-04-12 10:45:13 +02:00 committed by Thomas Lamprecht
parent 31150d20c4
commit bb547dcbd6

View File

@ -8576,6 +8576,10 @@ sub add_nets_bridge_fdb {
}
my $bridge = $net->{bridge};
if (!$bridge) {
log_warn("Interface '$iface' not attached to any bridge.");
next;
}
if ($have_sdn) {
PVE::Network::SDN::Zones::add_bridge_fdb($iface, $mac, $bridge, $net->{firewall});
} elsif (-d "/sys/class/net/$bridge/bridge") { # avoid fdb management with OVS for now