Browse Source

[2304] Minor additions in comments.

Marcin Siodelski 12 years ago
parent
commit
9062cbabae
2 changed files with 7 additions and 1 deletions
  1. 5 1
      src/lib/dhcp/option6_int.h
  2. 2 0
      src/lib/dhcp/option6_int_array.h

+ 5 - 1
src/lib/dhcp/option6_int.h

@@ -61,7 +61,7 @@ public:
     /// @param begin iterator to first byte of option data.
     /// @param end iterator to end of option data (first byte after option end).
     ///
-    /// @todo mention here what it throws.
+    /// @throw isc::OutOfRange if provided buffer is shorter than data size.
     Option6Int(uint16_t type, OptionBufferConstIter begin,
                OptionBufferConstIter end)
         : Option(Option::V6, type) {
@@ -108,10 +108,14 @@ public:
     ///
     /// @param begin iterator to first byte of option data
     /// @param end iterator to end of option data (first byte after option end)
+    ///
+    /// @throw isc::OutOfRange if provided buffer is shorter than data size.
     virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end) {
         if (distance(begin, end) < sizeof(T)) {
             isc_throw(OutOfRange, "Option " << getType() << " truncated");
         }
+        // @todo consider what to do if buffer is longer than data type.
+
         // Depending on the data type length we use different utility functions
         // readUint16 or readUint32 which read the data laid in the network byte
         // order from the provided buffer. The same functions can be safely used

+ 2 - 0
src/lib/dhcp/option6_int_array.h

@@ -145,6 +145,8 @@ public:
         if (distance(begin, end) % sizeof(T) != 0) {
             isc_throw(OutOfRange, "option " << getType() << " truncated");
         }
+        // @todo consider what to do if buffer is longer than data type.
+
         values_.clear();
         while (begin != end) {
             // Depending on the data type length we use different utility functions