Browse Source

[trac4265] Update copyrights and use HOP_COUNT_LIMIT instead of hardcoded value

Shawn Routhier 9 years ago
parent
commit
0e4e33caa8

+ 2 - 2
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");
     }
 

+ 1 - 1
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

+ 1 - 1
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

+ 2 - 1
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 <dhcp/dhcp6.h>
 #include <dhcp/option.h>
 #include <dhcp/option_definition.h>
 #include <dhcp/libdhcp++.h>
@@ -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");
 	}