diff --git a/ipv4/reservation/reservation.go b/ipv4/reservation/reservation.go index cb4854c..ee5301c 100644 --- a/ipv4/reservation/reservation.go +++ b/ipv4/reservation/reservation.go @@ -36,7 +36,7 @@ func ReserveV4MacAddr(identifierType string, identifier string, addr string, hos // This does not validate against the database, just validates that the written configuration // is correct func (r *ReservationV4) Validate() bool { - if typeValidator.IsValid(r.typeName) { + if !typeValidator.IsValid(r.typeName) { slog.Error("validate", slog.Any("reservationV4.type", "invalid")) return false } diff --git a/lib/validators/types/types.go b/lib/validators/types/types.go index 3c8dee4..5d1bedb 100644 --- a/lib/validators/types/types.go +++ b/lib/validators/types/types.go @@ -3,5 +3,5 @@ package types import "git.staur.ca/stobbsm/kea-manage/lib/types" func IsValid(identifierType string) bool { - return types.LookupIdentifier(identifierType) != 255 + return types.LookupIdentifier(identifierType) != types.Invalid }