summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsmos <seth.mos@dds.nl>2012-04-18 10:43:02 +0200
committersmos <seth.mos@dds.nl>2012-04-18 10:43:02 +0200
commit1a5f87d1c856115009101d29732c53094082c6a2 (patch)
tree2d277106d93b3bbc006b54c5dfbe4b1ff3ab1711
parent2f0a49e922e282a1abc641ec9d489f2678e069be (diff)
downloadpfsense-1a5f87d1c856115009101d29732c53094082c6a2.zip
pfsense-1a5f87d1c856115009101d29732c53094082c6a2.tar.gz
Handle multiple IPv6 DNS servers in rc.newwanipv6, remove chunk of broken code in the DHCPv6 server that added duplicate lines. Redmine ticket #2380
-rw-r--r--etc/inc/services.inc9
-rwxr-xr-xetc/rc.newwanipv610
2 files changed, 9 insertions, 10 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index cfe028e..98a0b77 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -654,6 +654,7 @@ function services_dhcpdv6_configure() {
/* kill any running dhcpd */
if(is_process_running("dhcpd")) {
killbypid("{$g['dhcpd_chroot_path']}{$g['varrun_path']}/dhcpdv6.pid");
+ killbypid("{$g['varrun_path']}/dhcpleases6.pid");
}
/* DHCP enabled on any interfaces? */
@@ -877,14 +878,6 @@ EOPP;
$subnet6 = Net_IPv6::compress(gen_subnetv6($ifcfgipv6, $ifcfgsnv6));
$dhcpdv6conf .= "subnet6 {$subnet6}/{$ifcfgsnv6} {\n";
- /* is failover dns setup? */
- if (is_array($dhcpv6ifconf['dnsserver']) && $dhcpv6ifconf['dnsserver'][0] <> "") {
- $dhcpdv6conf .= " option dhcp6.name-servers {$dhcpv6ifconf['dnsserver'][0]}";
- if($dhcpv6ifconf['dnsserver'][1] <> "")
- $dhcpdv6conf .= ",{$dhcpv6ifconf['dnsserver'][1]}";
- $dhcpdv6conf .= ";\n";
- }
-
if($dhcpv6ifconf['failover_peerip'] <> "")
$dhcpdv6conf .= " deny dynamic bootp clients;\n";
diff --git a/etc/rc.newwanipv6 b/etc/rc.newwanipv6
index ab3ef7a..9f02772 100755
--- a/etc/rc.newwanipv6
+++ b/etc/rc.newwanipv6
@@ -75,9 +75,15 @@ $curwanipv6 = get_interface_ipv6();
$interface = "wan";
$interface_real = get_real_interface();
-if(is_ipaddrv6(trim($_ENV['new_domain_name_servers']))) {
- file_put_contents("{$g['varetc_path']}/nameserver_v6{$interface}", trim($_ENV['new_domain_name_servers']));
+$name_servers = explode(" ", $_ENV['new_domain_name_servers']);
+$valid_ns = array();
+foreach($name_servers as $ns) {
+ if(is_ipaddrv6(trim($ns)))
+ $valid_ns[] = trim($ns);
}
+if(count($valid_ns > 0))
+ file_put_contents("{$g['varetc_path']}/nameserver_v6{$interface}", implode("\n", $valid_ns));
+
if(!empty($_ENV['new_domain_name'])) {
file_put_contents("{$g['varetc_path']}/searchdomain_v6{$interface}", $_ENV['new_domain_name']);
}
OpenPOWER on IntegriCloud