diff options
author | Ermal <eri@pfsense.org> | 2013-01-30 18:43:47 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-01-30 18:43:47 +0000 |
commit | 9cd6b950231ce5cbbaa1a93a46ea7d28e9839cbc (patch) | |
tree | 78331e4e8ee858a15b3b9763fe2e4e625e80ae25 /etc/rc.newwanipv6 | |
parent | e2a282a0b9f7ee1636e1c2ec15e767a2f5b43fb6 (diff) | |
download | pfsense-9cd6b950231ce5cbbaa1a93a46ea7d28e9839cbc.zip pfsense-9cd6b950231ce5cbbaa1a93a46ea7d28e9839cbc.tar.gz |
Do more strict checks. Also silence some more log_error under debug. Also do some sanity checks on rc.newwanipv6 before doing any operation
Diffstat (limited to 'etc/rc.newwanipv6')
-rwxr-xr-x | etc/rc.newwanipv6 | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/etc/rc.newwanipv6 b/etc/rc.newwanipv6 index 853194e..c2266ae 100755 --- a/etc/rc.newwanipv6 +++ b/etc/rc.newwanipv6 @@ -64,6 +64,9 @@ $argument = str_replace("\n", "", $argv[1]); log_error("rc.newwanipv6: Informational is starting {$argument}."); +/* wait for the dhcp6c process to configure the LAN interface */ +sleep(5); + if(empty($argument)) { $interface = "wan"; $interface_real = get_real_interface($interface); @@ -72,10 +75,22 @@ if(empty($argument)) { $interface_real = $argument; $interface = convert_real_interface_to_friendly_interface_name($interface_real); $curwanipv6 = find_interface_ipv6($interface_real, true); - if($curwanipv6 == "") + if (empty($curwanipv6)) $curwanipv6 = get_interface_ipv6($interface); } +if (empty($interface)) { + filter_configure(); + // restart_packages(); + exit; +} + +if(empty($curwanipv6) || !is_ipaddrv6($curwanipv6)) { + log_error("rc.newwanipv6: Failed to update {$interface} IPv6, restarting..."); + // send_event("interface reconfigure {$interface}"); + exit; +} + $name_servers = explode(" ", $_ENV['new_domain_name_servers']); $valid_ns = array(); foreach($name_servers as $ns) { @@ -91,18 +106,6 @@ if(!empty($_ENV['new_domain_name'])) log_error("rc.newwanipv6: on (IP address: {$curwanipv6}) (interface: {$interface}) (real interface: {$interface_real})."); -if($curwanipv6 == "" || !is_ipaddrv6($curwanipv6)) { - log_error("rc.newwanipv6: Failed to update {$interface} IPv6, restarting..."); - // send_event("interface reconfigure {$interface}"); - exit; -} - -if (empty($interface)) { - filter_configure(); - // restart_packages(); - exit; -} - $oldipv6 = ""; if (file_exists("{$g['vardb_path']}/{$interface}_cacheipv6")) $oldipv6 = file_get_contents("{$g['vardb_path']}/{$interface}_cacheipv6"); @@ -158,9 +161,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(); |