From 1cdf2c91cae0fd55be3ef8ca5c8a7d1dd61b25fd Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 20 Jul 2016 16:07:34 +0930 Subject: Formatting tidy of interfaces.inc After #3055 --- src/etc/inc/interfaces.inc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/etc') diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 76ea359..1a25d6b 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -1764,8 +1764,8 @@ EOD; /* Omit this, we maintain the default route by other means, and it causes problems with * default gateway switching. See redmine #1837 for original issue - * re-enabling this for now to fix issue with missing default gateway with PPPoE in some - * edge case. redmine #6495 open to address. + * re-enabling this for now to fix issue with missing default gateway with PPPoE in some + * edge case. redmine #6495 open to address. */ if (($interface == "wan" && $founddefaultgw == false) || $setdefaultgw == true) { $setdefaultgw = true; @@ -3028,11 +3028,12 @@ function find_dhcp6c_process($interface) { return intval($pid); } + function kill_dhcp6client_process($interface) { if (empty($interface) || !does_interface_exist($interface)) { return; } - + $i = 0; while ((($pid = find_dhcp6c_process($interface)) != 0) && ($i < 3)) { /* 3rd time make it die for sure */ @@ -3044,7 +3045,6 @@ function kill_dhcp6client_process($interface) { unset($i); } - function interface_virtual_create($interface) { global $config; @@ -3982,7 +3982,7 @@ function interface_dhcpv6_configure($interface = "wan", $wancfg) { $rtsoldscript .= "/usr/local/sbin/dhcp6c {$debugOption} -c {$g['varetc_path']}/dhcp6c_{$interface}.conf -p {$g['varrun_path']}/dhcp6c_{$wanif}.pid {$wanif}\n"; $rtsoldscript .= "/usr/bin/logger -t rtsold \"Starting dhcp6 client for interface {$interface}({$wanif})\"\n"; /* non ipoe Process */ - if (!isset($wancfg['dhcp6withoutra'])) { + if (!isset($wancfg['dhcp6withoutra'])) { $rtsoldscript .= "if [ -f {$g['varrun_path']}/dhcp6c_{$wanif}.pid ]; then\n"; $rtsoldscript .= "\t/bin/pkill -F {$g['varrun_path']}/dhcp6c_{$wanif}.pid\n"; $rtsoldscript .= "\t/bin/sleep 1\n"; @@ -3991,10 +3991,10 @@ function interface_dhcpv6_configure($interface = "wan", $wancfg) { $rtsoldscript .= "\t/bin/sleep 1\n"; } $debugOption = isset($wancfg['dhcp6debug']) ? "-D" : "-d"; - if (!isset($wancfg['dhcp6withoutra'])){ + if (!isset($wancfg['dhcp6withoutra'])) { $rtsoldscript .= "/usr/local/sbin/dhcp6c {$debugOption} -c {$g['varetc_path']}/dhcp6c_{$interface}.conf -p {$g['varrun_path']}/dhcp6c_{$wanif}.pid {$wanif}\n"; $rtsoldscript .= "/usr/bin/logger -t rtsold \"Starting dhcp6 client for interface {$interface}({$wanif})\"\n"; - } + } /* Add wide-dhcp6c shell script here. Because we can not pass a argument to it. */ if (!@file_put_contents("{$g['varetc_path']}/rtsold_{$wanif}_script.sh", $rtsoldscript)) { printf("Error: cannot open rtsold_{$wanif}_script.sh in interface_dhcpv6_configure() for writing.\n"); @@ -4014,11 +4014,11 @@ function interface_dhcpv6_configure($interface = "wan", $wancfg) { sleep(2); } if (isset($wancfg['dhcp6withoutra'])) { - kill_dhcp6client_process($wanif); - + kill_dhcp6client_process($wanif); + mwexec("/usr/local/sbin/dhcp6c {$debugOption} -x -c {$g['varetc_path']}/dhcp6c_wan.conf -p {$g['varrun_path']}/dhcp6c_{$wanif}.pid {$wanif}"); - mwexec("/usr/bin/logger -t mwtag 'Starting dhcp6 client for interface wan({$wanif} in IPoE mode)'"); - } + mwexec("/usr/bin/logger -t mwtag 'Starting dhcp6 client for interface wan({$wanif} in IPoE mode)'"); + } mwexec("/usr/sbin/rtsold -1 -p {$g['varrun_path']}/rtsold_{$wanif}.pid -O {$g['varetc_path']}/rtsold_{$wanif}_script.sh {$wanif}"); /* NOTE: will be called from rtsold invoked script -- cgit v1.1