System: Routes: Configuration - disable flag not removing static route. closes https://github.com/opnsense/core/issues/5887

looks like a regression in 52d3e7c676, after which delete doesn't seem to execute a valid route command.
This commit is contained in:
Ad Schellevis 2022-07-18 20:25:56 +02:00
parent efb4eb3f8f
commit 4e9baba4d0

View File

@ -631,7 +631,8 @@ function system_staticroutes_configure($interface = '')
$ip = $rtent['network'];
if (!empty($rtent['disabled'])) {
$inet = (is_subnetv6($ip) ? "-inet6" : "-inet");
mwexec("/sbin/route delete {$inet}", true);
$cmd = " {$inet} {$blackhole} " . escapeshellarg($ip) . " ";
mwexec("/sbin/route delete {$cmd}", true);
} else {
$inet = (is_subnetv6($ip) ? "-inet6" : "-inet");
$cmd = " {$inet} {$blackhole} " . escapeshellarg($ip) . " ";