From da145569d2e6bf6451b6a55219116625691a0e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20LU=C3=87I?= Date: Thu, 27 Nov 2014 12:07:00 +0100 Subject: Handle recovering of ppp types as pppoe/l2tp/pp2p when the parent comes up. It should solve the issues present before on pppoe not recovering on link loss especially when connected directly to modem. --- etc/rc.linkup | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/etc/rc.linkup b/etc/rc.linkup index 373f7a1..fa44d4e 100755 --- a/etc/rc.linkup +++ b/etc/rc.linkup @@ -123,9 +123,25 @@ if (!platform_booting()) { log_error("Ignoring link event for ovpn interface"); return; } - $interface = convert_real_interface_to_friendly_interface_name($realiface, 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) { + $tmpiface = get_real_interface($parent_if); + $tmpiface = convert_real_interface_to_friendly_interface_name($realiface); + if (!empty($tmpiface)) + interface_configure($tmpiface, true, true); + } + } + } + } } } -- cgit v1.1