summaryrefslogtreecommitdiffstats
path: root/etc/rc.newwanipv6
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2014-04-12 06:20:32 +0000
committerErmal <eri@pfsense.org>2014-04-12 06:21:12 +0000
commit91571af53adba6d3f5472e72fca6256c53766abe (patch)
tree5eace1bf688bcd97cfb2157648ca6ec40e4623e3 /etc/rc.newwanipv6
parentd6fa556643af9b7b6479ea5e4e082a80795d8d56 (diff)
downloadpfsense-91571af53adba6d3f5472e72fca6256c53766abe.zip
pfsense-91571af53adba6d3f5472e72fca6256c53766abe.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-xetc/rc.newwanipv617
1 files changed, 12 insertions, 5 deletions
diff --git a/etc/rc.newwanipv6 b/etc/rc.newwanipv6
index 1c91a9b..25295e5 100755
--- a/etc/rc.newwanipv6
+++ b/etc/rc.newwanipv6
@@ -62,7 +62,7 @@ else
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);
@@ -72,6 +72,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();
@@ -82,8 +84,12 @@ if (empty($interface)) {
if ($g['booting'] && $config['interfaces'][$interface]['ipaddrv6'] != "dhcp6")
return;
+/*
+ * 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}");
return;
}
@@ -111,7 +117,8 @@ if (!empty($new_domain_name))
file_put_contents("{$g['varetc_path']}/searchdomain_v6{$interface}", $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}).");
@@ -151,9 +158,9 @@ if (is_ipaddrv6($oldipv6)) {
return;
} 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);
OpenPOWER on IntegriCloud