Browse Source

[trac998] simple, mostly editorial suggested fixes.

JINMEI Tatuya 14 years ago
parent
commit
79ec6c320e
2 changed files with 9 additions and 9 deletions
  1. 8 8
      src/lib/acl/ip_check.h
  2. 1 1
      src/lib/acl/tests/ip_check_unittest.cc

+ 8 - 8
src/lib/acl/ip_check.h

@@ -152,9 +152,9 @@ public:
     /// \param address IP address to check for (as an address in host-byte
     ///        order).  Note host-byte order - this is different to the IPV6
     ///        constructor.
-    /// \param prefixlen The prefix length specified as an integer between 0 and
-    ///        32. This determines the number of bits of the address to check.
-    ///        (A value of zero imples match all IPV4 addresses.)
+    /// \param prefixlen The prefix length specified as an integer between 0
+    ///        and 32. This determines the number of bits of the address to
+    ///        check. (A value of zero imples match all IPV4 addresses.)
     IPCheck(uint32_t address, int prefixlen = 8 * IPV4_SIZE) :
             address_(IPV4_SIZE), mask_(), family_(AF_INET)
     {
@@ -175,8 +175,9 @@ public:
     ///
     /// \param address IP address to check for (as an address in network-byte
     ///        order).
-    /// \param mask The network mask specified as an integer between 1 and
-    ///        128 This determines the number of bits in the mask to check.
+    /// \param prefixlen The prefix length specified as an integer between 0
+    ///        and 128.  This determines the number of bits of the address to
+    ///        check.
     IPCheck(const uint8_t* address, int prefixlen = 8 * IPV6_SIZE) :
             address_(address, address + IPV6_SIZE), mask_(), family_(AF_INET6)
     {
@@ -197,8 +198,7 @@ public:
     ///        address).  If "n" is specified as zero, the match is for any
     ///        address in that address family.  The address can also be
     ///        given as "any4" or "any6".
-    IPCheck(const std::string& ipprefix) : address_(), mask_(), family_(0)
-    {
+    IPCheck(const std::string& ipprefix) : address_(), mask_(), family_(0) {
         // Check for special cases first.
         if (ipprefix == "any4") {
             family_ = AF_INET;
@@ -210,7 +210,7 @@ public:
 
             // General address prefix.  Split into address part and prefix
             // length.
-            std::pair<std::string, int> result =
+            const std::pair<std::string, int> result =
                 internal::splitIPAddress(ipprefix);
 
             // Try to convert the address.  If successful, the result is in

+ 1 - 1
src/lib/acl/tests/ip_check_unittest.cc

@@ -77,7 +77,7 @@ struct GeneralAddress {
     // Check that the IPV4 address is the same as that given.
     bool equals(uint32_t address) {
         if (addr.size() == IPV4_SIZE) {
-            vector<uint8_t> byte_address = convertUint32(address);
+            const vector<uint8_t> byte_address = convertUint32(address);
             return (equal(byte_address.begin(), byte_address.end(),
                            addr.begin()));
         }