]> git.ipfire.org Git - people/stevee/network.git/commitdiff
pppoe-server: Check for valid network pppoe-server-fix
authorStefan Schantl <stefan.schantl@ipfire.org>
Sat, 10 Oct 2015 18:00:10 +0000 (20:00 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sat, 10 Oct 2015 18:00:10 +0000 (20:00 +0200)
The pppoe-server did not proper check if a valid
IPv4 or IPv6 network has been specified.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
src/hooks/configs/pppoe-server

index 1ef3ba9c5208ecbef1a262a9bdfa7be57546ea0c..ac9b90a074ff13827857f32aada8c02401f18c79 100644 (file)
@@ -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}"