summaryrefslogtreecommitdiffstats
path: root/etc/rc.newwanipv6
diff options
context:
space:
mode:
authorsmos <seth.mos@dds.nl>2013-01-05 16:01:43 +0100
committersmos <seth.mos@dds.nl>2013-01-05 16:02:28 +0100
commitd53a9a5100c83988cd7479e9228c27f2ab09760e (patch)
treef72872fa4b351c27b217939e84d86fb9ad917bc2 /etc/rc.newwanipv6
parentdcb4155504df9994c6c95e6bd511076b23e531af (diff)
downloadpfsense-d53a9a5100c83988cd7479e9228c27f2ab09760e.zip
pfsense-d53a9a5100c83988cd7479e9228c27f2ab09760e.tar.gz
The ISC client was far worse then the WIDE client was, back to plan A
Revert "Merge changes required for using the ISC dhclient in pfSense with prefix delegation. This should hopefully be a bit more reliable in the long run." This reverts commit 651018775c78e38045966825b920b641a0302b43. Conflicts: etc/inc/interfaces.inc
Diffstat (limited to 'etc/rc.newwanipv6')
-rwxr-xr-xetc/rc.newwanipv642
1 files changed, 29 insertions, 13 deletions
diff --git a/etc/rc.newwanipv6 b/etc/rc.newwanipv6
index cc1927e..e09b4c7 100755
--- a/etc/rc.newwanipv6
+++ b/etc/rc.newwanipv6
@@ -49,6 +49,15 @@ if($g['booting'])
exit;
+// echo print_r($_ENV, true);
+/*Array
+(
+ [REASON] => NBI
+ [new_domain_name_servers] => 2001:470:20::2
+ [new_domain_name] => domain.nl.
+)
+*/
+
function restart_packages() {
global $oldip, $curwanipv6, $g;
@@ -61,16 +70,24 @@ function restart_packages() {
log_error("rc.newwanipv6: Informational is starting.");
-/* Interface IP address has changed */
-$argument = str_replace("\n", "", $argv[1]);
-
-if($argument != "")
- $interface = convert_real_interface_to_friendly_interface_name($argument);
-else
- $interface = "wan";
+/* FIXME: how can we find out about the correct interface name? */
+/* switch to ISC dhcp6 client? */
+$curwanipv6 = get_interface_ipv6();
+$interface = "wan";
+$interface_real = get_real_interface();
+
+$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));
-$interface_real = get_real_interface($interface);
-$curwanipv6 = get_interface_ipv6($interface_real);
+if(!empty($_ENV['new_domain_name'])) {
+ file_put_contents("{$g['varetc_path']}/searchdomain_v6{$interface}", $_ENV['new_domain_name']);
+}
log_error("rc.newwanipv6: on (IP address: {$curwanipv6}) (interface: {$interface}) (real interface: {$interface_real}).");
@@ -100,10 +117,6 @@ system_resolvconf_generate(true);
/* write current WAN IPv6 to file */
file_put_contents("{$g['vardb_path']}/{$interface}_ipv6", $curwanipv6);
-/* pickup ipv6 router advertisements */
-pickup_ipv6_router_advertisement($interface_real);
-sleep(3);
-
/* check native IPv6 interface tracking */
switch($config['interfaces'][$interface]['ipaddrv6']) {
case "dhcp6":
@@ -145,6 +158,9 @@ services_dnsupdate_process($interface);
/* signal dyndns update */
services_dyndns_configure($interface);
+/* wait for the dhcp6c process to configure the LAN interface */
+sleep(5);
+
/* reconfigure IPsec tunnels */
vpn_ipsec_force_reload();
OpenPOWER on IntegriCloud