From 37a32842fd737a832e8a5d4e7cfdb3440153eec2 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 30 Dec 2024 16:03:59 +0100 Subject: [PATCH] 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. --- src/etc/inc/system.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index a4db7cb8b..0c97b3932 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -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);