From bb1f0151d6fc78bdac2ac81e7bc327eca14a359d Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 12 Apr 2019 14:56:29 +0200 Subject: [PATCH] Routing, gateways. ditch lookup_gateway_ip_by_name() usage from system_resolvconf_generate() in system.inc, for https://github.com/opnsense/core/issues/2279 --- src/etc/inc/system.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index 5e9ebab1b..5a4784e55 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -185,13 +185,14 @@ function system_resolvconf_generate($verbose = false) chmod('/etc/resolv.conf', 0644); /* setup static routes for DNS servers. */ + $gateways = new \OPNsense\Routing\Gateways(legacy_interfaces_details()); for ($dnscounter = 1; $dnscounter < 9; $dnscounter++) { /* setup static routes for dns servers */ $dnsgw = "dns{$dnscounter}gw"; if (isset($syscfg[$dnsgw])) { $gwname = $syscfg[$dnsgw]; if (($gwname != '') && ($gwname != 'none')) { - $gatewayip = lookup_gateway_ip_by_name($gwname); + $gatewayip = $gateways->getAddress($gwname); if (is_ipaddrv4($gatewayip)) { /* dns server array starts at 0 */ $dnscountermo = $dnscounter - 1;