Merge: * dhcp: validate range_start/range_end values
Close #848 * commit '625b22a8d7bece655216b926f1b4ce35e14ccb07': * dhcp: validate range_start/range_end values
This commit is contained in:
commit
c7b5b00d14
|
@ -129,6 +129,9 @@ func (s *Server) setConfig(config ServerConfig) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return wrapErrPrint(err, "Failed to parse range end address %s", config.RangeEnd)
|
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)
|
subnet, err := parseIPv4(config.SubnetMask)
|
||||||
if err != nil || !isValidSubnetMask(subnet) {
|
if err != nil || !isValidSubnetMask(subnet) {
|
||||||
|
|
Loading…
Reference in New Issue