mirror of
https://git.proxmox.com/git/pve-common
synced 2025-07-29 16:25:50 +00:00
etc_network_interfaces : handle autostart for ovs
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
parent
bd9cc42d82
commit
f48815f8b6
@ -902,8 +902,8 @@ sub __read_etc_network_interfaces {
|
|||||||
chomp ($line);
|
chomp ($line);
|
||||||
next if $line =~ m/^\s*#/;
|
next if $line =~ m/^\s*#/;
|
||||||
|
|
||||||
if ($line =~ m/^\s*auto\s+(.*)$/) {
|
if ($line =~ m/^\s*(auto|allow-ovs)\s+(.*)$/) {
|
||||||
my @aa = split (/\s+/, $1);
|
my @aa = split (/\s+/, $2);
|
||||||
|
|
||||||
foreach my $a (@aa) {
|
foreach my $a (@aa) {
|
||||||
$ifaces->{$a}->{autostart} = 1;
|
$ifaces->{$a}->{autostart} = 1;
|
||||||
@ -1599,12 +1599,14 @@ NETWORKDOC
|
|||||||
}
|
}
|
||||||
|
|
||||||
$printed->{$iface} = 1;
|
$printed->{$iface} = 1;
|
||||||
|
if ($d->{autostart}) {
|
||||||
if ($d->{type} eq 'OVSBridge') {
|
if ($d->{type} eq 'OVSBridge') {
|
||||||
# cannot use 'auto' for OVS, would add race with systemd ifup@.service
|
# cannot use 'auto' for OVS, would add race with systemd ifup@.service
|
||||||
$raw .= "allow-ovs $iface\n";
|
$raw .= "allow-ovs $iface\n";
|
||||||
} elsif ($d->{autostart}) {
|
} else {
|
||||||
$raw .= "auto $iface\n";
|
$raw .= "auto $iface\n";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
my $i = 0; # some options should be printed only once
|
my $i = 0; # some options should be printed only once
|
||||||
$raw .= __interface_to_string($iface, $d, $_, !$i++, $ifupdown2) foreach @{$d->{families}};
|
$raw .= __interface_to_string($iface, $d, $_, !$i++, $ifupdown2) foreach @{$d->{families}};
|
||||||
|
Loading…
Reference in New Issue
Block a user