From: Michael Tremer Date: Sun, 16 Sep 2018 11:50:30 +0000 (+0100) Subject: pppoe: Bring up port when zone is coming up X-Git-Tag: 010~98 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=82cd861762cca41751dc68dc8101f0e444884940;p=network.git pppoe: Bring up port when zone is coming up Signed-off-by: Michael Tremer --- diff --git a/src/hooks/zones/pppoe b/src/hooks/zones/pppoe index 021d89b2..e113c92e 100644 --- a/src/hooks/zones/pppoe +++ b/src/hooks/zones/pppoe @@ -363,6 +363,36 @@ hook_port_detach() { exit ${EXIT_OK} } +hook_port_up() { + assert [ $# -eq 2 ] + + local zone="${1}" + local port="${2}" + + # Try bringing up the port if it has not been brought up before + if ! device_exists "${port}"; then + port_create "${port}" + fi + + # Make sure that the port is up + port_up "${port}" + + exit ${EXIT_OK} +} + +hook_port_down() { + assert [ $# -eq 2 ] + + local zone="${1}" + local port="${2}" + + if device_exists "${port}"; then + port_down "${port}" + fi + + exit ${EXIT_OK} +} + hook_ppp_ipv6_up() { local zone="${1}"