From e0a862e2c0cf0764b0469692e60e5137f114d8ca Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 18 Jan 2017 10:48:11 +0100 Subject: [PATCH] fix #1232: cleanup bridges on veth_delete When a container stops or hotplug changes are applied we do a veth_delete() which does not cleanup the firewall bridges or OVS ports. This is problematic at the next startup. When creating a network device we usually want to copy the MTU of the bridge we intend to put it on, however, with OVS still having the old port lying around the recreated device gets associated with the bridge before we read its MTU, potentially reducing it to that of the newly created device. This cleanup also gets rid of stale fwbr/fwln devices from stopped containers. --- src/PVE/Network.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE/Network.pm b/src/PVE/Network.pm index 1c03770..27492b5 100644 --- a/src/PVE/Network.pm +++ b/src/PVE/Network.pm @@ -277,7 +277,7 @@ sub veth_delete { if (-d "/sys/class/net/$veth") { run_command("/sbin/ip link delete dev $veth", outfunc => sub {}, errfunc => sub {}); } - + eval { tap_unplug($veth) }; } my $create_firewall_bridge_linux = sub { -- 2.39.2