-// Copyright (C) 2012-2021 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2022 Internet Systems Consortium, Inc. ("ISC")
//
// 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
if (subnet_id->intValue() <= 0) {
isc_throw(BadValue, "subnet-id " << subnet_id->intValue() << " is not"
- << " a positive integer");
+ << " a positive integer");
+ } else if (subnet_id->intValue() > numeric_limits<uint32_t>::max()) {
+ isc_throw(BadValue, "subnet-id " << subnet_id->intValue() << " is not"
+ << " a 32 bit unsigned integer");
}
lease->subnet_id_ = SubnetID(subnet_id->intValue());
-// Copyright (C) 2013-2020 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2022 Internet Systems Consortium, Inc. ("ISC")
//
// 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
testInvalidElement<Lease4>(json, "state", 1234, false);
testInvalidElement<Lease4>(json, "subnet-id", std::string("xyz"));
testInvalidElement<Lease4>(json, "subnet-id", -5, false);
+ testInvalidElement<Lease4>(json, "subnet-id", 0x100000000, false);
testInvalidElement<Lease4>(json, "valid-lft", std::string("xyz"));
testInvalidElement<Lease4>(json, "valid-lft", -3, false);
testInvalidElement<Lease4>(json, "user-context", "[ ]", false);
testInvalidElement<Lease6>(json, "state", 1234, false);
testInvalidElement<Lease6>(json, "subnet-id", std::string("xyz"));
testInvalidElement<Lease6>(json, "subnet-id", -5, false);
+ testInvalidElement<Lease6>(json, "subnet-id", 0x100000000, false);
testInvalidElement<Lease6>(json, "type", std::string("IA_XY"));
testInvalidElement<Lease6>(json, "type", -3, false);
testInvalidElement<Lease6>(json, "valid-lft", std::string("xyz"));