The pppoe-server did not proper check if a valid
IPv4 or IPv6 network has been specified.
Signed-off-by: Stefan Schantl <stefan.schantl(a)ipfire.org>
---
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