mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 00:07:26 +00:00
system: improve static routes error handling
3c7fb657e14dfc muted "delete" operations but also "add" which makes it impossible to see failures like the latest regression fixed in 25e2c0a301e1. Since system_default_route() handles this accordingly use the same approach here.
This commit is contained in:
parent
25e2c0a301
commit
07f07fff3b
@ -678,6 +678,7 @@ function system_routing_configure($verbose = false, $interface = null, $monitor
|
||||
break;
|
||||
}
|
||||
|
||||
/* XXX some day we might want to convert to safer mwexecf() */
|
||||
$cmd = " -{$ipproto} {$blackhole} " . escapeshellarg($rtent['network']) . " ";
|
||||
|
||||
if (!empty($rtent['disabled'])) {
|
||||
@ -687,14 +688,14 @@ function system_routing_configure($verbose = false, $interface = null, $monitor
|
||||
mwexec("/sbin/route delete {$cmd}", true);
|
||||
if ($fargw) {
|
||||
mwexecf('/sbin/route delete -%s %s -interface %s ', [$ipproto, $gatewayip, $interfacegw], true);
|
||||
mwexecf('/sbin/route add -%s %s -interface %s', [$ipproto, $gatewayip, $interfacegw], true);
|
||||
mwexecf('/sbin/route add -%s %s -interface %s', [$ipproto, $gatewayip, $interfacegw]);
|
||||
} elseif (is_linklocal($gatewayip) && strpos($gatewayip, '%') === false) {
|
||||
$gatewayip .= "%{$interfacegw}";
|
||||
}
|
||||
mwexec("/sbin/route add" . $cmd . escapeshellarg($gatewayip), true);
|
||||
mwexec("/sbin/route add" . $cmd . escapeshellarg($gatewayip));
|
||||
} elseif (!empty($interfacegw)) {
|
||||
mwexec("/sbin/route delete" . $cmd . "-interface " . escapeshellarg($interfacegw), true);
|
||||
mwexec("/sbin/route add" . $cmd . "-interface " . escapeshellarg($interfacegw), true);
|
||||
mwexec("/sbin/route add" . $cmd . "-interface " . escapeshellarg($interfacegw));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user