mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-03 15:35:17 +00:00
[#722,!1] Addressed review comments
src/lib/dhcp/duid.cc - improved log message
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2012-2016 Internet Systems Consortium, Inc. ("ISC")
|
// Copyright (C) 2012-2019 Internet Systems Consortium, Inc. ("ISC")
|
||||||
//
|
//
|
||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
@@ -22,8 +22,8 @@ namespace dhcp {
|
|||||||
|
|
||||||
DUID::DUID(const std::vector<uint8_t>& duid) {
|
DUID::DUID(const std::vector<uint8_t>& duid) {
|
||||||
if (duid.size() > MAX_DUID_LEN) {
|
if (duid.size() > MAX_DUID_LEN) {
|
||||||
isc_throw(isc::BadValue, "DUID is " << duid.size()
|
isc_throw(isc::BadValue, "DUID size is " << duid.size()
|
||||||
<< ", exceeds max of " << MAX_DUID_LEN);
|
<< " bytes, exceeds maximum of " << MAX_DUID_LEN);
|
||||||
}
|
}
|
||||||
if (duid.empty()) {
|
if (duid.empty()) {
|
||||||
isc_throw(isc::BadValue, "Empty DUIDs are not allowed");
|
isc_throw(isc::BadValue, "Empty DUIDs are not allowed");
|
||||||
@@ -33,8 +33,8 @@ DUID::DUID(const std::vector<uint8_t>& duid) {
|
|||||||
|
|
||||||
DUID::DUID(const uint8_t* data, size_t len) {
|
DUID::DUID(const uint8_t* data, size_t len) {
|
||||||
if (len > MAX_DUID_LEN) {
|
if (len > MAX_DUID_LEN) {
|
||||||
isc_throw(isc::BadValue, "DUID is " << len
|
isc_throw(isc::BadValue, "DUID size is " << len
|
||||||
<< ", exceeds max of " << MAX_DUID_LEN);
|
<< " bytes, exceeds maximum of " << MAX_DUID_LEN);
|
||||||
}
|
}
|
||||||
if (len == 0) {
|
if (len == 0) {
|
||||||
isc_throw(isc::BadValue, "Empty DUIDs/Client-ids not allowed");
|
isc_throw(isc::BadValue, "Empty DUIDs/Client-ids not allowed");
|
||||||
@@ -46,7 +46,6 @@ DUID::DUID(const uint8_t* data, size_t len) {
|
|||||||
const std::vector<uint8_t>& DUID::getDuid() const {
|
const std::vector<uint8_t>& DUID::getDuid() const {
|
||||||
return (duid_);
|
return (duid_);
|
||||||
}
|
}
|
||||||
|
|
||||||
DUID::DUIDType DUID::getType() const {
|
DUID::DUIDType DUID::getType() const {
|
||||||
if (duid_.size() < 2) {
|
if (duid_.size() < 2) {
|
||||||
return (DUID_UNKNOWN);
|
return (DUID_UNKNOWN);
|
||||||
|
Reference in New Issue
Block a user