Routing, gateways. ditch lookup_gateway_ip_by_name() usage from system_resolvconf_generate() in system.inc, for https://github.com/opnsense/core/issues/2279

This commit is contained in:
Ad Schellevis 2019-04-12 14:56:29 +02:00
parent a6340f8032
commit bb1f0151d6

View File

@ -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;