From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Schantl To: network@lists.ipfire.org Subject: [network] [PATCH] pppoe-server: Check for valid network Date: Thu, 15 Oct 2015 15:49:52 +0200 Message-ID: <1444916992-7458-1-git-send-email-stefan.schantl@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5498387757510413961==" List-Id: --===============5498387757510413961== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The pppoe-server did not proper check if a valid IPv4 or IPv6 network has been specified. Signed-off-by: Stefan Schantl --- src/hooks/configs/pppoe-server | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hooks/configs/pppoe-server b/src/hooks/configs/pppoe-server index 1ef3ba9..ac9b90a 100644 --- a/src/hooks/configs/pppoe-server +++ b/src/hooks/configs/pppoe-server @@ -42,6 +42,12 @@ hook_check_config_settings() { assert isset SUBNET assert isset MAX_SESSIONS + # Check input. + if ! ip_is_network "${SUBNET}"; then + log ERROR "Invalid subnet. Please provide a valid IPv6 or IPv4 network." + return ${EXIT_ERROR} + fi + local server for server in ${DNS_SERVERS}; do assert ipv4_is_valid "${server}" -- 2.4.3 --===============5498387757510413961==--