From e9ba128993b7da5a18d60bc7dce40dcb21c8a3b2 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 12 Apr 2019 12:17:24 +0200 Subject: [PATCH] Routing, gateways. replace return_gateways_array() in system_staticroutes_configure, for https://github.com/opnsense/core/issues/2279 --- 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 ef80eb8e1..5e9ebab1b 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -559,8 +559,8 @@ function system_staticroutes_configure($interface = '') { $static_routes = get_staticroutes(false, true); if (count($static_routes)) { - $gateways_arr = return_gateways_array(false, true); - + $ifdetails = legacy_interfaces_details(); + $gateways_arr = (new \OPNsense\Routing\Gateways($ifdetails))->gatewaysIndexedByName(false, true); foreach ($static_routes as $rtent) { if (empty($gateways_arr[$rtent['gateway']])) { log_error(sprintf('Static Routes: Gateway IP could not be found for %s', $rtent['network'])); @@ -575,7 +575,7 @@ function system_staticroutes_configure($interface = '') log_error(sprintf('Cannot add static route to: %s', $rtent['network'])); continue; } - $interfacegw = $gateway['interface']; + $interfacegw = $gateway['if']; $gatewayip = $gateway['gateway']; $fargw = isset($gateway['fargw']) && $gateway['ipprotocol'] != 'inet6'; $blackhole = '';