* dhcp: validate range_start/range_end values

This commit is contained in:
Simon Zolin 2019-08-23 14:44:23 +03:00
parent 307b934cf1
commit 625b22a8d7
1 changed files with 3 additions and 0 deletions

View File

@ -129,6 +129,9 @@ func (s *Server) setConfig(config ServerConfig) error {
if err != nil {
return wrapErrPrint(err, "Failed to parse range end address %s", config.RangeEnd)
}
if dhcp4.IPRange(s.leaseStart, s.leaseStop) <= 0 {
return wrapErrPrint(err, "DHCP: Incorrect range_start/range_end values")
}
subnet, err := parseIPv4(config.SubnetMask)
if err != nil || !isValidSubnetMask(subnet) {