From 60966cdaa2e2245e2b459e0546c812dda2442925 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 26 Apr 2019 14:27:47 +0200 Subject: [PATCH] system: gateway_items are not dynamic --- src/opnsense/mvc/app/library/OPNsense/Routing/Gateways.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/opnsense/mvc/app/library/OPNsense/Routing/Gateways.php b/src/opnsense/mvc/app/library/OPNsense/Routing/Gateways.php index 5e4947335..3a6964f03 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Routing/Gateways.php +++ b/src/opnsense/mvc/app/library/OPNsense/Routing/Gateways.php @@ -205,7 +205,8 @@ class Gateways "name" => strtoupper("{$descr}_{$ctype}"), "descr" => "Interface " . strtoupper("{$descr}_{$ctype}") . " Gateway", "monitor_disable" => true, // disable monitoring by default - "if" => $ifcfg['if'] + "if" => $ifcfg['if'], + "dynamic" => true, ]; // locate interface gateway settings if (!empty($dynamic_gw[$ifname])) { @@ -217,7 +218,6 @@ class Gateways } } } - $thisconf['dynamic'] = true; // dynamic gateways dump their address in /tmp/[IF]_router[FSUFFIX] if (file_exists("/tmp/{$ifcfg['if']}_router".$fsuffix)) { $thisconf['gateway'] = trim(@file_get_contents("/tmp/{$ifcfg['if']}_router".$fsuffix)); @@ -232,6 +232,9 @@ class Gateways // gateway should only contain a valid address, make sure its empty unset($thisconf['gateway']); $this->cached_gateways[$gwkey] = $thisconf; + } elseif (empty($thisconf['dynamic'])) { + $gwkey = $this->newKey($thisconf['priority'], !empty($thisconf['defaultgw'])); + $this->cached_gateways[$gwkey] = $thisconf; } } }