From: Shawn Routhier Date: Fri, 5 Jun 2015 03:41:20 +0000 (-0700) Subject: [trac3618] Tidy up some typos found while reviewing. X-Git-Tag: trac3618_18june X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f5fd8565e7adeafd04a9adec60c6edb9d2a8703;p=thirdparty%2Fkea.git [trac3618] Tidy up some typos found while reviewing. --- diff --git a/src/lib/dhcp/libdhcp++.cc b/src/lib/dhcp/libdhcp++.cc index 3a30b66b8d..1036ea03cf 100644 --- a/src/lib/dhcp/libdhcp++.cc +++ b/src/lib/dhcp/libdhcp++.cc @@ -296,8 +296,8 @@ size_t LibDHCP::unpackOptions6(const OptionBuffer& buf, if (opt_type == D6O_VENDOR_OPTS) { if (offset + 4 > length) { - // Truncated vendor-option. There is expected at least - // 4 bytes long enterprise-id field. Let's roll back + // Truncated vendor-option. We expect at least + // 4 bytes for the enterprise-id field. Let's roll back // option code + option length (4 bytes) and return. return (offset - 4); } @@ -311,7 +311,6 @@ size_t LibDHCP::unpackOptions6(const OptionBuffer& buf, continue; } - // Get all definitions with the particular option code. Note // that option code is non-unique within this container // however at this point we expect to get one option @@ -562,7 +561,7 @@ size_t LibDHCP::unpackVendorOptions4(const uint32_t vendor_id, const OptionBuffe while (offset + 1 <= buf.size()) { // Note that Vendor-Specific info option (RFC3925) has a // different option format than Vendor-Spec info for - // DHCPv6. (there's additional layer of data-length + // DHCPv6. (there's additional layer of data-length) uint8_t data_len = buf[offset++]; if (offset + data_len > buf.size()) { diff --git a/src/lib/dhcp/libdhcp++.h b/src/lib/dhcp/libdhcp++.h index 45b0ae388d..3876fac513 100644 --- a/src/lib/dhcp/libdhcp++.h +++ b/src/lib/dhcp/libdhcp++.h @@ -1,4 +1,4 @@ -// Copyright (C) 2011-2014 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC") // // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above @@ -144,7 +144,7 @@ public: /// /// @param buf Buffer to be parsed. /// @param option_space A name of the option space which holds definitions - /// of to be used to parse options in the packets. + /// to be used to parse options in the packets. /// @param options Reference to option container. Options will be /// put here. /// @return offset to the first byte after the last successfully parsed option @@ -158,14 +158,14 @@ public: /// container. The last two parameters are optional and are used in /// relay parsing. If they are specified, relay-msg option is not created, /// but rather those two parameters are specified to point out where - /// the relay-msg option resides and what is its length. This is perfromance + /// the relay-msg option resides and what is its length. This is a performance /// optimization that avoids unnecessary copying of potentially large /// relay-msg option. It is not used for anything, except in the next /// iteration its content will be treated as buffer to be parsed. /// /// @param buf Buffer to be parsed. /// @param option_space A name of the option space which holds definitions - /// of to be used to parse options in the packets. + /// to be used to parse options in the packets. /// @param options Reference to option container. Options will be /// put here. /// @param relay_msg_offset reference to a size_t structure. If specified, diff --git a/src/lib/dhcp/tests/libdhcp++_unittest.cc b/src/lib/dhcp/tests/libdhcp++_unittest.cc index d06b0607f3..0ac73a6e93 100644 --- a/src/lib/dhcp/tests/libdhcp++_unittest.cc +++ b/src/lib/dhcp/tests/libdhcp++_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2011-2014 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC") // // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above diff --git a/src/lib/dhcp/tests/pkt4_unittest.cc b/src/lib/dhcp/tests/pkt4_unittest.cc index 71489a1ce3..255156f9bc 100644 --- a/src/lib/dhcp/tests/pkt4_unittest.cc +++ b/src/lib/dhcp/tests/pkt4_unittest.cc @@ -678,7 +678,7 @@ TEST_F(Pkt4Test, unpackMalformed) { Pkt4Ptr success(new Pkt4(&orig[0], orig.size())); EXPECT_NO_THROW(success->unpack()); - // At the exception of END and PAD an option must have a length byte + // With the exception of END and PAD an option must have a length byte vector nolength = orig; nolength.resize(orig.size() - 4); Pkt4Ptr no_length_pkt(new Pkt4(&nolength[0], nolength.size())); @@ -742,7 +742,7 @@ TEST_F(Pkt4Test, unpackVendorMalformed) { Pkt4Ptr bad_data_len_pkt(new Pkt4(&baddatalen[0], baddatalen.size())); EXPECT_THROW(bad_data_len_pkt->unpack(), InvalidOptionValue); - // At the exception of END and PAD, a suboption must have a length byte + // A suboption must have a length byte vector nolength = orig; nolength.resize(orig.size() - 4); nolength[full_len_index] = 11; @@ -750,7 +750,7 @@ TEST_F(Pkt4Test, unpackVendorMalformed) { Pkt4Ptr no_length_pkt(new Pkt4(&nolength[0], nolength.size())); EXPECT_THROW(no_length_pkt->unpack(), InvalidOptionValue); - // Truncated data is not accepted too + // Truncated data is not accepted either vector shorty = orig; shorty.resize(orig.size() - 1); shorty[full_len_index] = 14; diff --git a/src/lib/dhcp/tests/pkt6_unittest.cc b/src/lib/dhcp/tests/pkt6_unittest.cc index a1740c251e..56d759daaf 100755 --- a/src/lib/dhcp/tests/pkt6_unittest.cc +++ b/src/lib/dhcp/tests/pkt6_unittest.cc @@ -340,7 +340,7 @@ TEST_F(Pkt6Test, unpackMalformed) { // Let's check a truncated packet. Moderately sane DHCPv6 packet should at // least have four bytes header. Zero bytes is definitely not a valid one. OptionBuffer empty(1); // Let's allocate one byte, so we won't be - // dereferencing and empty buffer. + // dereferencing an empty buffer. Pkt6Ptr empty_pkt(new Pkt6(&empty[0], 0)); EXPECT_THROW(empty_pkt->unpack(), isc::BadValue);