From: Alexandre Derumier Date: Fri, 21 Feb 2020 09:28:11 +0000 (+0100) Subject: INotify: use auto for ovs interfaces with ifupdown2 X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=d34d73932843428b974cdda647de36358fb0f62e INotify: use auto for ovs interfaces with ifupdown2 Need the ifupdown2 openvswitch addon ! --- diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm index d3998cd..0136f32 100644 --- a/src/PVE/INotify.pm +++ b/src/PVE/INotify.pm @@ -1311,7 +1311,12 @@ sub __interface_to_string { $done->{ovs_type} = 1; if (my $bridge = $d->{ovs_bridge}) { - $raw = "allow-$bridge $iface\n$raw"; + if ($ifupdown2) { + $raw = "auto $iface\n$raw"; + } else { + $raw = "allow-$bridge $iface\n$raw"; + } + $raw .= "\tovs_bridge $bridge\n"; $done->{ovs_bridge} = 1; } @@ -1653,7 +1658,7 @@ NETWORKDOC $printed->{$iface} = 1; if ($d->{autostart}) { - if ($d->{type} eq 'OVSBridge') { + if ($d->{type} eq 'OVSBridge' && !$ifupdown2) { # cannot use 'auto' for OVS, would add race with systemd ifup@.service $raw .= "allow-ovs $iface\n"; } else {