diff options
author | Ermal LUÇI <eri@pfsense.org> | 2014-11-27 15:06:39 +0100 |
---|---|---|
committer | Ermal LUÇI <eri@pfsense.org> | 2014-11-27 15:06:39 +0100 |
commit | 7e677d8555d2eba1f72d2b3581b3042005c78544 (patch) | |
tree | 054c0f23090fc3b1e2a766f8360123d3f4ba8e9b /etc | |
parent | f72ea82a9bcdbcac6041e6df460f82517e762968 (diff) | |
download | pfsense-7e677d8555d2eba1f72d2b3581b3042005c78544.zip pfsense-7e677d8555d2eba1f72d2b3581b3042005c78544.tar.gz |
Simplify code flow not functional change just aesthetics.
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/rc.linkup | 85 |
1 files changed, 43 insertions, 42 deletions
diff --git a/etc/rc.linkup b/etc/rc.linkup index 923679a..372d7b6 100755 --- a/etc/rc.linkup +++ b/etc/rc.linkup @@ -36,6 +36,9 @@ require_once("filter.inc"); require_once("shaper.inc"); require_once("interfaces.inc"); +if (platform_booting()) + return; + function handle_argument_group($iface, $argument2) { global $config; @@ -95,51 +98,49 @@ function handle_argument_group($iface, $argument2) { } } -if (!platform_booting()) { - if (isset($_GET['interface'])) { - if (!empty($_GET['interface'])) - $realiface = $_GET['interface']; - $action = $_GET['action']; - } else { - if ($argc < 3) { - log_error("HOTPLUG event: The required number of parameters not passed!"); - return; - } - $action = $argv[1]; - $realiface = $argv[2]; +if (isset($_GET['interface'])) { + if (!empty($_GET['interface'])) + $realiface = $_GET['interface']; + $action = $_GET['action']; +} else { + if ($argc < 3) { + log_error("HOTPLUG event: The required number of parameters not passed!"); + return; } - switch($action) { - case "start": - case "stop": - break; - default: - log_error("HOTPLUG event: Action parameter ($action) passed is wrong - only start/stop/up/down are allowed!"); + $action = $argv[1]; + $realiface = $argv[2]; +} +switch($action) { +case "start": +case "stop": + break; +default: + log_error("HOTPLUG event: Action parameter ($action) passed is wrong - only start/stop/up/down are allowed!"); + return; + /* NOTREACHED */ + break; +} +if (!empty($realiface)) { + if (substr($realiface, 0, 4) == 'ovpn') { + log_error("Ignoring link event for ovpn interface"); return; - /* NOTREACHED */ - break; } - if (!empty($realiface)) { - if (substr($realiface, 0, 4) == 'ovpn') { - log_error("Ignoring link event for ovpn interface"); - return; - } - $interface = convert_real_interface_to_friendly_interface_name($realiface); - if (!empty($interface)) - handle_argument_group($interface, $action); - if ($action == 'start') { - /* Check if there is any child on this one as ppp types and trigger them */ - if (is_array($config['ppps']['ppp'])) { - foreach ($config['ppps']['ppp'] as $pppidx => $ppp) { - if ($ppp['type'] == 'ppp') - continue; - $ports = explode(',', $ppp['ports']); - foreach ($ports as $pid => $parent_if) { - /* The loop here is because ppp types can have real and assigned interfaces as members */ - $tmpiface = get_real_interface($parent_if); - $tmpiface = convert_real_interface_to_friendly_interface_name($realiface); - if (!empty($tmpiface)) - interface_configure($tmpiface, true, true); - } + $interface = convert_real_interface_to_friendly_interface_name($realiface); + if (!empty($interface)) + handle_argument_group($interface, $action); + if ($action == 'start') { + /* Check if there is any child on this one as ppp types and trigger them */ + if (is_array($config['ppps']['ppp'])) { + foreach ($config['ppps']['ppp'] as $pppidx => $ppp) { + if ($ppp['type'] == 'ppp') + continue; + $ports = explode(',', $ppp['ports']); + foreach ($ports as $pid => $parent_if) { + /* The loop here is because ppp types can have real and assigned interfaces as members */ + $tmpiface = get_real_interface($parent_if); + $tmpiface = convert_real_interface_to_friendly_interface_name($realiface); + if (!empty($tmpiface)) + interface_configure($tmpiface, true, true); } } } |