System: Routes: Configuration - add support for rfc5549, missing implementation part for https://github.com/opnsense/core/issues/8157

When specifying different protocols for target network and gateway address, add protocol prefixes to both.
This commit is contained in:
Ad Schellevis 2024-12-30 16:03:59 +01:00
parent 52255d7e46
commit 37a32842fd

View File

@ -751,6 +751,10 @@ function system_routing_configure($verbose = false, $interface_map = null, $moni
/* XXX some day we might want to convert to safer mwexecf() */
$cmd = " -{$ipproto} {$blackhole} " . escapeshellarg($rtent['network']) . " ";
if (is_ipaddrv6($gatewayip) && $ipproto == 'inet') {
/* rfc5549: gateway protocol differs, so we need to define it as well */
$cmd .= ' -inet6 ';
}
if (!empty($rtent['disabled'])) {
mwexec("/sbin/route delete {$cmd}", true);