// The client-id or server-id has to have at least 3 bytes of useful data:
// two for duid type and one more for actual duid value.
uint16_t len = opt->len() - opt->getHeaderLen();
- if ( (len < 3) || (len > DUID::MAX_DUID_LEN) ) {
- isc_throw(RFCViolation, "Received " << opt_name << " option with invalid length: "
- << len << ", expected 3..128.");
+ if (len < 3 || len > DUID::MAX_DUID_LEN || opt->getData().empty()) {
+ isc_throw(RFCViolation, "Received invalid DUID for " << opt_name << ", received "
+ << len << " byte(s). It must be at least 3 and no more than "
+ << DUID::MAX_DUID_LEN);
}
}