diff options
author | Phil Davis <phil.davis@inf.org> | 2017-01-12 21:44:19 +0545 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-01-13 18:50:14 -0200 |
commit | d88f26df4d7c31393df082c6397e65e096e63a75 (patch) | |
tree | 9a4333c4a86e919eb8b11d649e7432f7dfd34a1d /src/etc | |
parent | 848ace91857315ce3bc120e59a735d2fd7b9af98 (diff) | |
download | pfsense-d88f26df4d7c31393df082c6397e65e096e63a75.zip pfsense-d88f26df4d7c31393df082c6397e65e096e63a75.tar.gz |
Redmine #5549 Allow variable number of DNS Servers
(cherry picked from commit a2d23e88596deab6bbed2818385a0b72c913843a)
Diffstat (limited to 'src/etc')
-rw-r--r-- | src/etc/inc/system.inc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index c690188..24cca6e 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -234,14 +234,12 @@ function system_resolvconf_generate($dynupdate = false) { } /* setup static routes for DNS servers. */ - for ($dnscounter=1; $dnscounter<5; $dnscounter++) { + $dnscounter = 1; + $dnsgw = "dns{$dnscounter}gw"; + while (isset($config['system'][$dnsgw])) { /* setup static routes for dns servers */ - $dnsgw = "dns{$dnscounter}gw"; - if (isset($config['system'][$dnsgw])) { - if (empty($config['system'][$dnsgw]) || - $config['system'][$dnsgw] == "none") { - continue; - } + if (!(empty($config['system'][$dnsgw]) || + $config['system'][$dnsgw] == "none")) { $gwname = $config['system'][$dnsgw]; $gatewayip = lookup_gateway_ip_by_name($gwname); $inet6 = is_ipaddrv6($gatewayip) ? '-inet6 ' : ''; @@ -262,6 +260,8 @@ function system_resolvconf_generate($dynupdate = false) { log_error("ROUTING debug: $mt - route {$cmd} -host {$inet6}{$dnsserver} {$gatewayip}"); } } + $dnscounter++; + $dnsgw = "dns{$dnscounter}gw"; } unlock($dnslock); |