From: Shawn Routhier Date: Wed, 6 Apr 2016 18:41:53 +0000 (-0700) Subject: [trac4265] Update copyrights and use HOP_COUNT_LIMIT instead of hardcoded value X-Git-Tag: trac4106_update_base~51^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e4e33caa8a3eb2a7ab0a6471af2a319f85826e6;p=thirdparty%2Fkea.git [trac4265] Update copyrights and use HOP_COUNT_LIMIT instead of hardcoded value --- diff --git a/src/lib/dhcp/pkt6.cc b/src/lib/dhcp/pkt6.cc index cc45d8d3b1..ac774c53a3 100644 --- a/src/lib/dhcp/pkt6.cc +++ b/src/lib/dhcp/pkt6.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2011-2016 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 @@ -447,7 +447,7 @@ Pkt6::unpackRelayMsg() { void Pkt6::addRelayInfo(const RelayInfo& relay) { - if (relay_info_.size() > 32) { + if (relay_info_.size() > HOP_COUNT_LIMIT) { isc_throw(BadValue, "Massage cannot be encapsulated more than 32 times"); } diff --git a/src/lib/dhcp/pkt6.h b/src/lib/dhcp/pkt6.h index bade98f362..44eed2b320 100644 --- a/src/lib/dhcp/pkt6.h +++ b/src/lib/dhcp/pkt6.h @@ -1,4 +1,4 @@ -// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2011-2016 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 diff --git a/src/lib/dhcp/tests/pkt6_unittest.cc b/src/lib/dhcp/tests/pkt6_unittest.cc index 0859575be5..fa7c750e09 100644 --- a/src/lib/dhcp/tests/pkt6_unittest.cc +++ b/src/lib/dhcp/tests/pkt6_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2011-2016 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 diff --git a/src/lib/eval/eval_context.cc b/src/lib/eval/eval_context.cc index 188d5f1d9d..059cb0fe63 100644 --- a/src/lib/eval/eval_context.cc +++ b/src/lib/eval/eval_context.cc @@ -4,6 +4,7 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include #include #include #include @@ -103,7 +104,7 @@ EvalContext::convertNestLevelNumber(const std::string& nest_level, error(loc, "Nest level has invalid value in " + nest_level); } if (option_universe_ == Option::V6) { - if (n < 0 || n > 31) { + if (n < 0 || n >= HOP_COUNT_LIMIT) { error(loc, "Nest level has invalid value in " + nest_level + ". Allowed range: 0..31"); }