summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@dds.nl>2011-08-24 10:51:03 +0200
committerSeth Mos <seth.mos@dds.nl>2011-08-24 10:51:03 +0200
commitc935003d50babb33e2c0e0771c0ee8a3503975b9 (patch)
treec72082cf8d2905adbfbc3a39c3204633edfbecc8 /etc
parent9d8ee15bcc1ab421224702e1bd552cc2fb4d7936 (diff)
downloadpfsense-c935003d50babb33e2c0e0771c0ee8a3503975b9.zip
pfsense-c935003d50babb33e2c0e0771c0ee8a3503975b9.tar.gz
Update the system.inc code that sets up the static routes for DNS servers to reflect the interface to gateway name conversion
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/system.inc15
1 files changed, 10 insertions, 5 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index e3a4558..bc62e24 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -138,16 +138,21 @@ function system_resolvconf_generate($dynupdate = false) {
/* setup static routes for DNS servers. */
for ($dnscounter=1; $dnscounter<5; $dnscounter++) {
/* setup static routes for dns servers */
- $dnsgw = "dns{$dnscounter}gwint";
+ $dnsgw = "dns{$dnscounter}gw";
if (isset($config['system'][$dnsgw])) {
- $interface = $config['system'][$dnsgw];
- if (($interface <> "") && ($interface <> "none")) {
- $gatewayip = get_interface_gateway($interface);
- if (is_ipaddr($gatewayip)) {
+ $gwname = $config['system'][$dnsgw];
+ if (($gwname <> "") && ($gwname <> "none")) {
+ $gatewayip = lookup_gateway_ip_by_name($gwname);
+ if (is_ipaddrv4($gatewayip)) {
/* dns server array starts at 0 */
$dnscountermo = $dnscounter - 1;
mwexec("route change -host " . $syscfg['dnsserver'][$dnscountermo] . " {$gatewayip}");
}
+ if (is_ipaddrv6($gatewayip)) {
+ /* dns server array starts at 0 */
+ $dnscountermo = $dnscounter - 1;
+ mwexec("route change -host inet6 " . $syscfg['dnsserver'][$dnscountermo] . " {$gatewayip}");
+ }
}
}
}
OpenPOWER on IntegriCloud