]> git.proxmox.com Git - pve-common.git/commitdiff
network: followup code cleanup
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 20 Sep 2019 07:42:05 +0000 (09:42 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 20 Sep 2019 07:43:29 +0000 (09:43 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/INotify.pm

index b3e5ab05fd22763f63c6dd51798fa2273b7a9dde..65b2d9113f993898b0bd66941472ac7c501a898f 100644 (file)
@@ -1294,10 +1294,9 @@ sub __interface_to_string {
        $raw .= "\tovs_type $d->{type}\n";
        $done->{ovs_type} = 1;
 
-       if ($d->{ovs_bridge}) {
-
-           $raw = "allow-$d->{ovs_bridge} $iface\n$raw";
-           $raw .= "\tovs_bridge $d->{ovs_bridge}\n";
+       if (my $bridge = $d->{ovs_bridge}) {
+           $raw = "allow-$bridge $iface\n$raw";
+           $raw .= "\tovs_bridge $bridge\n";
            $done->{ovs_bridge} = 1;
        }
     }
@@ -1600,10 +1599,11 @@ NETWORKDOC
        }
 
        $printed->{$iface} = 1;
-        if ($d->{type} eq 'OVSBridge') {
+       if ($d->{type} eq 'OVSBridge') {
+           # cannot use 'auto' for OVS, would add race with systemd ifup@.service
            $raw .= "allow-ovs $iface\n";
        } elsif ($d->{autostart}) {
-           $raw .= "auto $iface\n" if $d->{autostart};
+           $raw .= "auto $iface\n";
        }
 
        my $i = 0; # some options should be printed only once