+ remove, list static leases
This commit is contained in:
@@ -300,7 +300,28 @@ func (s *Server) handleDHCPRemoveStaticLease(w http.ResponseWriter, r *http.Requ
|
||||
return
|
||||
}
|
||||
|
||||
ip, _ := parseIPv4(lj.IP)
|
||||
ip := net.ParseIP(lj.IP)
|
||||
if ip != nil && ip.To16() != nil {
|
||||
mac, err := net.ParseMAC(lj.HWAddr)
|
||||
if err != nil {
|
||||
httpError(r, w, http.StatusBadRequest, "invalid MAC")
|
||||
return
|
||||
}
|
||||
|
||||
lease := Lease{
|
||||
IP: ip,
|
||||
HWAddr: mac,
|
||||
}
|
||||
|
||||
err = s.v6RemoveStaticLease(lease)
|
||||
if err != nil {
|
||||
httpError(r, w, http.StatusBadRequest, "%s", err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
ip, _ = parseIPv4(lj.IP)
|
||||
if ip == nil {
|
||||
httpError(r, w, http.StatusBadRequest, "invalid IP")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user