summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-12-20 22:49:46 +0000
committerErmal <eri@pfsense.org>2013-12-20 22:49:46 +0000
commitaf8251cc74c4dadf2ee7f6bd48bb44c01fe65053 (patch)
treefdabd124ece69fd057b67d56a0808135a959f16d /etc
parente800a773c46b9b9a6592d36157b5a7ef222caced (diff)
downloadpfsense-af8251cc74c4dadf2ee7f6bd48bb44c01fe65053.zip
pfsense-af8251cc74c4dadf2ee7f6bd48bb44c01fe65053.tar.gz
Addapt rc.newwanipv6 to FCGI calling
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/interfaces.inc4
-rwxr-xr-xetc/rc.newwanipv623
2 files changed, 18 insertions, 9 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index fe800dd..60476a3 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -3569,8 +3569,8 @@ function interface_dhcpv6_configure($interface = "wan", $wancfg) {
$dhcp6cscript = "#!/bin/sh\n";
$dhcp6cscript .= "# This shell script launches /etc/rc.newwanipv6 with a interface argument.\n";
$dhcp6cscript .= "\$dmips = \${new_domain_name_servers}\n";
- $dhcp6cscript .= "\$dmservers = \${new_domain_name}\n";
- $dhcp6cscript .= "/usr/local/sbin/fcgicli -f /etc/rc.newwanipv6 -d \"interface={$wanif}&dmservers=\$dmservers&dmips=\$dmips\"\n";
+ $dhcp6cscript .= "\$dmnames = \${new_domain_name}\n";
+ $dhcp6cscript .= "/usr/local/sbin/fcgicli -f /etc/rc.newwanipv6 -d \"interface={$wanif}&dmnames=\$dmnames&dmips=\$dmips\"\n";
/* Add wide-dhcp6c shell script here. Because we can not pass a argument to it. */
if (!@file_put_contents("{$g['varetc_path']}/dhcp6c_{$interface}_script.sh", $dhcp6cscript)) {
printf("Error: cannot open dhcp6c_{$interface}_script.sh in interface_dhcpv6_configure() for writing.\n");
diff --git a/etc/rc.newwanipv6 b/etc/rc.newwanipv6
index dec1736..ab3909e 100755
--- a/etc/rc.newwanipv6
+++ b/etc/rc.newwanipv6
@@ -55,7 +55,10 @@ function restart_packages() {
}
/* Interface IP address has changed */
-$argument = trim($argv[1], " \n\t");
+if (isset($_GET))
+ $argument = $_GET['interface'];
+else
+ $argument = trim($argv[1], " \n\t");
log_error("rc.newwanipv6: Informational is starting {$argument}.");
@@ -72,20 +75,23 @@ if(empty($argument)) {
if (empty($interface)) {
filter_configure();
// restart_packages();
- exit;
+ return;
}
//Do not process while booting
if ($g['booting'] && $config['interfaces'][$interface]['ipaddrv6'] != "dhcp6")
- exit;
+ return;
if (empty($curwanipv6) || !is_ipaddrv6($curwanipv6)) {
log_error("rc.newwanipv6: Failed to update {$interface} IPv6, restarting...");
// send_event("interface reconfigure {$interface}");
- exit;
+ return;
}
-$new_domain_name_servers = getenv("new_domain_name_servers");
+if (isset($_GET))
+ $new_domain_name_servers = $_GET['dmips'];
+else
+ $new_domain_name_servers = getenv("new_domain_name_servers");
if (!empty($new_domain_name_servers)) {
$name_servers = explode(" ", $new_domain_name_servers);
$valid_ns = array();
@@ -97,7 +103,10 @@ if (!empty($new_domain_name_servers)) {
if (count($valid_ns > 0))
file_put_contents("{$g['varetc_path']}/nameserver_v6{$interface}", implode("\n", $valid_ns));
}
-$new_domain_name = getenv("new_domain_name");
+if (isset($_GET))
+ $new_domain_name = $_GET['dmnames'];
+else
+ $new_domain_name = getenv("new_domain_name");
if (!empty($new_domain_name))
file_put_contents("{$g['varetc_path']}/searchdomain_v6{$interface}", $new_domain_name);
@@ -139,7 +148,7 @@ if (is_ipaddrv6($oldipv6)) {
if (substr($interface_real, 0, 4) != "ovpn")
openvpn_resync_all($interface);
}
- exit;
+ return;
} else if (does_interface_exist($interface_real))
mwexec("/sbin/ifconfig {$interface_real} inet6 {$oldipv6} delete");
}
OpenPOWER on IntegriCloud