summaryrefslogtreecommitdiffstats
path: root/etc/rc.newwanipv6
diff options
context:
space:
mode:
Diffstat (limited to 'etc/rc.newwanipv6')
-rwxr-xr-xetc/rc.newwanipv642
1 files changed, 13 insertions, 29 deletions
diff --git a/etc/rc.newwanipv6 b/etc/rc.newwanipv6
index e09b4c7..cc1927e 100755
--- a/etc/rc.newwanipv6
+++ b/etc/rc.newwanipv6
@@ -49,15 +49,6 @@ 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;
@@ -70,24 +61,16 @@ function restart_packages() {
log_error("rc.newwanipv6: Informational is starting.");
-/* 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 IP address has changed */
+$argument = str_replace("\n", "", $argv[1]);
-if(!empty($_ENV['new_domain_name'])) {
- file_put_contents("{$g['varetc_path']}/searchdomain_v6{$interface}", $_ENV['new_domain_name']);
-}
+if($argument != "")
+ $interface = convert_real_interface_to_friendly_interface_name($argument);
+else
+ $interface = "wan";
+
+$interface_real = get_real_interface($interface);
+$curwanipv6 = get_interface_ipv6($interface_real);
log_error("rc.newwanipv6: on (IP address: {$curwanipv6}) (interface: {$interface}) (real interface: {$interface_real}).");
@@ -117,6 +100,10 @@ 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":
@@ -158,9 +145,6 @@ 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