chomp $line;
if ($line =~ m/^(search|domain)\s+(\S+)\s*/) {
$res->{search} = $2;
- } elsif ($line =~ m/^nameserver\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s*/) {
+ } elsif ($line =~ m/^\s*nameserver\s+($PVE::Tools::IPRE)\s*/) {
$nscount++;
if ($nscount <= 3) {
$res->{"dns$nscount"} = $1;
my $saved = $task->{saved} ? 1 : 0;
if ($task->{endtime}) {
if ($task->{status}) {
- $raw .= sprintf("$upid $saved %08X $task->{status}\n", $task->{endtime});
+ $raw .= sprintf("%s %s %08X %s\n", $upid, $saved, $task->{endtime}, $task->{status});
} else {
- $raw .= sprintf("$upid $saved %08X\n", $task->{endtime});
+ $raw .= sprintf("%s %s %08X\n", $upid, $saved, $task->{endtime});
}
} else {
$raw .= "$upid $saved\n";
}
}
- # Remove autostart from linux bridge ports
- foreach my $iface (keys %$ifaces) {
- my $d = $ifaces->{$iface};
- if ($d->{type} eq 'bridge' && $d->{bridge_ports}) {
- foreach my $p (split (/\s+/, $d->{bridge_ports})) {
- my $n = $ifaces->{$p};
- die "bridge '$iface' - unable to find port '$p'\n"
- if !$n;
- $n->{autostart} = 0;
- }
- }
- }
-
# check OVS bond ports
foreach my $iface (keys %$ifaces) {
my $d = $ifaces->{$iface};
my $printed = {};
my $if_type_hash = {
- unknown => 0,
loopback => 100000,
eth => 200000,
bond => 300000,
$pri = $if_type_hash->{bridge} + $child;
}
- return $pri || ($if_type_hash->{unknown} + $child);
+ return $pri;
};
foreach my $iface (sort {
my $ref1 = $ifaces->{$a};
my $ref2 = $ifaces->{$b};
- my $p1 = &$lookup_type_prio($a);
- my $p2 = &$lookup_type_prio($b);
+ my $tp1 = &$lookup_type_prio($a);
+ my $tp2 = &$lookup_type_prio($b);
+
+ # Only recognized types are in relation to each other. If one type
+ # is unknown then only consider the interfaces' priority attributes.
+ $tp1 = $tp2 = 0 if !defined($tp1) || !defined($tp2);
- $p1 += $ref1->{priority} // 50000;
- $p2 += $ref2->{priority} // 50000;
+ my $p1 = $tp1 + ($ref1->{priority} // 50000);
+ my $p2 = $tp2 + ($ref2->{priority} // 50000);
return $p1 <=> $p2 if $p1 != $p2;