summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormarjohn56 <martin@queens-park.com>2017-03-11 09:59:44 +0000
committermarjohn56 <martin@queens-park.com>2017-03-12 11:03:53 +0000
commit07c304a5593e4fc7d574964bbf3641f92c16d8fa (patch)
tree199131ff0b2dee8e95e53faa230edc36d6355d11 /src
parent718cbc2d3921627e9767e59d539386c843dffcc4 (diff)
downloadpfsense-07c304a5593e4fc7d574964bbf3641f92c16d8fa.zip
pfsense-07c304a5593e4fc7d574964bbf3641f92c16d8fa.tar.gz
WAN flap loss of IPv6
Some hardware is taking too long to set ACCEPT_RTADV on the Interface, this results in RTSOLD exiting and this not sending RS to start the process. Apart from adding a delay to the start of RTSOLD which did improve but not totally fix the issue the other change is to prevent the call to -ACCEPT_RTADV if the interface is using DHCP6. -ACCEPT_RTADV in the case of wancfg['dhcp6usev4iface'] || $wancfg['ipaddr']==='ppp' Cleaning up dhcp6c kill calls. ppp-ipv6 Changed to call kill_dhcp6client_process() to make sure the lock files are also cleared. Interfaces.php Changed to call kill_dhcp6client_process() to make sure the lock files are also cleared.
Diffstat (limited to 'src')
-rw-r--r--src/etc/inc/interfaces.inc21
-rwxr-xr-xsrc/usr/local/sbin/ppp-ipv67
-rwxr-xr-xsrc/usr/local/www/interfaces.php5
3 files changed, 21 insertions, 12 deletions
diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc
index 273b8ff..57f53fb 100644
--- a/src/etc/inc/interfaces.inc
+++ b/src/etc/inc/interfaces.inc
@@ -3095,6 +3095,14 @@ function kill_dhcp6client_process($interface, $force, $release = false) {
unlink_if_exists("/tmp/dhcp6c_{$interface}_lock");
unlink_if_exists("{$g['varrun_path']}/dhcp6c_{$interface}.pid"); // just in case!
}
+function reset_dhcp6client_process($interface) {
+
+ $pid = find_dhcp6c_process($interface);
+
+ if($pid != 0) {
+ posix_kill($pid, SIGHUP);
+ }
+}
function run_dhcp6client_process($interface, $wancfg) {
global $g;
@@ -3292,8 +3300,10 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven
if ($g['debug']) {
log_error(sprintf(gettext("Deny router advertisements for interface %s"), $interface));
}
- mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " inet6 -accept_rtadv", true);
-
+ if (isset($wancfg['dhcp6usev4iface']) || $wancfg['ipaddr']==='ppp')
+ {
+ mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " inet6 -accept_rtadv", true);
+ }
/* wireless configuration? */
if (is_array($wancfg['wireless'])) {
interface_wireless_configure($realif, $wancfg, $wancfg['wireless']);
@@ -4211,7 +4221,9 @@ function interface_dhcpv6_configure($interface = "wan", $wancfg) {
"-p {$g['varrun_path']}/dhcp6c_{$wanif}.pid {$wanif}\n";
$rtsoldscript .= "\t/usr/bin/logger -t rtsold \"Starting dhcp6 client for interface {$interface}({$wanif})\"\n";
$rtsoldscript .= "else\n";
- $rtsoldscript .= "\t/usr/bin/logger -t rtsold \"RTSOLD Lock in place\"\n";
+ $rtsoldscript .= "\t/usr/bin/logger -t rtsold \"RTSOLD Lock in place - sending SIGHUP to dhcp6c\"\n";
+ $rtsoldscript .= "\tdhcp6c_pid=\$(cat \"{$g['varrun_path']}/dhcp6c_{$wanif}.pid\")\n";
+ $rtsoldscript .= "\t/bin/kill -1 \${dhcp6c_pid}\n";
$rtsoldscript .= "fi\n";
} else {
/*
@@ -4233,6 +4245,7 @@ function interface_dhcpv6_configure($interface = "wan", $wancfg) {
if (isvalidpid("{$g['varrun_path']}/rtsold_{$wanif}.pid")) {
killbypid("{$g['varrun_path']}/rtsold_{$wanif}.pid");
+ log_error("Killing running rtsold process");
sleep(2);
}
@@ -4265,6 +4278,8 @@ function interface_dhcpv6_configure($interface = "wan", $wancfg) {
* ( it does not background, it exits! ) It will launch dhcp6c
* if dhcpwihtoutra is not set
*/
+ log_error("Starting rtsold process");
+ sleep(2);
mwexec("/usr/sbin/rtsold -1 " .
"-p {$g['varrun_path']}/rtsold_{$wanif}.pid " .
"-O {$g['varetc_path']}/rtsold_{$wanif}_script.sh " .
diff --git a/src/usr/local/sbin/ppp-ipv6 b/src/usr/local/sbin/ppp-ipv6
index 53d9bcc..c98e1f1 100755
--- a/src/usr/local/sbin/ppp-ipv6
+++ b/src/usr/local/sbin/ppp-ipv6
@@ -41,11 +41,8 @@ function interface_ipv6_lower($interface_real) {
break;
}
// bring down dhcp6c if it is running
- $pidv6 = find_dhcp6c_process($interface_real);
- if ($pidv6) {
- posix_kill($pidv6, SIGTERM);
- sleep(3);
- }
+ kill_dhcp6client_process($interface_real,false);
+
unlink_if_exists("{$g['varetc_path']}/dhcp6c_{$interface}.conf");
// disable router advertisements (and therefore SLAAC)
diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php
index 7b68440..f8f8e6b 100755
--- a/src/usr/local/www/interfaces.php
+++ b/src/usr/local/www/interfaces.php
@@ -986,10 +986,7 @@ if ($_POST['apply']) {
kill_dhclient_process($wancfg['if']);
}
if ($wancfg['ipaddrv6'] == "dhcp6") {
- $pid = find_dhcp6c_process($wancfg['if']);
- if ($pid) {
- posix_kill($pid, SIGTERM);
- }
+ kill_dhcp6client_process($wancfg['if'],true);
}
}
$ppp = array();
OpenPOWER on IntegriCloud