Length of input for lease6-get-by-duid is not validated
The issue was found by @andrei during 1.15 sanity checks: #1296 (comment 434113)
Searching leases by two-character or four-character words provide warnings.
This is caused by an error response e.g. [ { "result": 1, "text": "identifier is too short (2), at least 3 is required" } ]
to the lease6-get-by-duid
command. This could be avoided by having Stork check this requirement up front and prevent the command from being sent, as it does with other input. As the comment in lease.go
says
// Kea does not accept empty DUIDs. Empty DUID in Kea is represented by 1 zero byte (Kea < 2.3.8) or 3 zero bytes (Kea >= 2.3.8).`
The current situation can be confusing to a user trying to determine why an even number of characters and bytes is more problematic than an odd number of characters which is checked upfront by Stork.