diff options
author | Ermal <eri@pfsense.org> | 2014-04-12 06:20:32 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2014-04-12 06:20:32 +0000 |
commit | f96b9a1830ee2b08c142207ebfa4f695d0628853 (patch) | |
tree | ee62a2a5a5e9779188b66b8a17b311becbcc3fc7 /etc/rc.newwanipv6 | |
parent | d22169cfd68a26c04ca6d1aa997575f1b3e4cc80 (diff) | |
download | pfsense-f96b9a1830ee2b08c142207ebfa4f695d0628853.zip pfsense-f96b9a1830ee2b08c142207ebfa4f695d0628853.tar.gz |
Take care of the loops reported for OpenVPN in tap mode. Also fixes the problems of tap disappearing from bridge if its a member.
Diffstat (limited to 'etc/rc.newwanipv6')
-rwxr-xr-x | etc/rc.newwanipv6 | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/etc/rc.newwanipv6 b/etc/rc.newwanipv6 index 92fe5ea..3da6ac9 100755 --- a/etc/rc.newwanipv6 +++ b/etc/rc.newwanipv6 @@ -59,7 +59,7 @@ $argument = trim($argv[1], " \n\t"); log_error("rc.newwanipv6: Informational is starting {$argument}."); -if(empty($argument)) { +if (empty($argument)) { $interface = "wan"; $interface_real = get_real_interface($interface, "inet6"); $curwanipv6 = get_interface_ipv6($interface, true); @@ -69,6 +69,8 @@ if(empty($argument)) { $curwanipv6 = get_interface_ipv6($interface, true); } +$interface_descr = convert_friendly_interface_to_friendly_descr($interface); + if (empty($interface)) { filter_configure(); // restart_packages(); @@ -79,8 +81,12 @@ if (empty($interface)) { if ($g['booting'] && $config['interfaces'][$interface]['ipaddrv6'] != "dhcp6") exit; +/* + * NOTE: Take care of openvpn and similar if you generate the event to reconfigure an interface. + * i.e. OpenVPN might be in tap mode and not have an ip. + */ if (empty($curwanipv6) || !is_ipaddrv6($curwanipv6)) { - log_error("rc.newwanipv6: Failed to update {$interface} IPv6, restarting..."); + log_error("rc.newwanipv6: Failed to update {$interface_descr}[{$interface}] IPv6, restarting..."); // send_event("interface reconfigure {$interface}"); exit; } @@ -100,7 +106,8 @@ if (!empty($_ENV['new_domain_name'])) file_put_contents("{$g['varetc_path']}/searchdomain_v6{$interface}", $_ENV['new_domain_name']); /* write current WAN IPv6 to file */ -file_put_contents("{$g['vardb_path']}/{$interface}_ipv6", $curwanipv6); +if (is_ipaddrv6($curwanipv6)) + @file_put_contents("{$g['vardb_path']}/{$interface}_ipv6", $curwanipv6); log_error("rc.newwanipv6: on (IP address: {$curwanipv6}) (interface: {$interface}) (real interface: {$interface_real})."); @@ -140,9 +147,9 @@ if (is_ipaddrv6($oldipv6)) { exit; } else if (does_interface_exist($interface_real)) mwexec("/sbin/ifconfig {$interface_real} inet6 {$oldipv6} delete"); -} -file_put_contents("{$g['vardb_path']}/{$interface}_cacheipv6", $curwanipv6); + file_put_contents("{$g['vardb_path']}/{$interface}_cacheipv6", $curwanipv6); +} /* perform RFC 2136 DNS update */ services_dnsupdate_process($interface); |