From a683004fbab5f94a1d5e122c8ea9433cd705ebc3 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sat, 25 May 2024 09:46:23 +0200 Subject: [PATCH] System: Gateways: Configuration - regression in Gateway MVC conversion forcing far gateways where none should exist. closes https://github.com/opnsense/core/issues/7483 This might be the cause of some weird VPN issues earlier as well, because a host route will prevent the actual address being configured later in some cases. While here, also fix a minor php warning (item doesn't exist). --- src/etc/inc/system.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index 2fb539148..804509626 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -551,7 +551,7 @@ function system_interface_route($gw, $routes) { $interface = $gw['interface']; $gateway = $gw['gateway'] ?? 'missing'; - $far = isset($gw['fargw']); + $far = !empty($gw['fargw']); $device = $gw['if']; $family = 'inet'; @@ -726,8 +726,8 @@ function system_routing_configure($verbose = false, $interface = null, $monitor } $interfacegw = $gateway['if']; - $gatewayip = $gateway['gateway']; - $fargw = isset($gateway['fargw']) && $gateway['ipprotocol'] != 'inet6'; + $gatewayip = $gateway['gateway'] ?? ''; + $fargw = !empty($gateway['fargw']) && $gateway['ipprotocol'] != 'inet6'; $blackhole = ''; switch ($rtent['gateway']) {