* dhcpd: check if subnet mask is correct

This commit is contained in:
Simon Zolin
2019-07-17 11:55:21 +03:00
parent 0fb42e5c71
commit 79a5c920a4
3 changed files with 30 additions and 1 deletions

View File

@@ -127,7 +127,7 @@ func (s *Server) setConfig(config ServerConfig) error {
}
subnet, err := parseIPv4(config.SubnetMask)
if err != nil {
if err != nil || !isValidSubnetMask(subnet) {
return wrapErrPrint(err, "Failed to parse subnet mask %s", config.SubnetMask)
}