BIND 10 #1226: V4 packet library - packet parsing

BIND 10 Development do-not-reply at isc.org
Wed Oct 26 11:24:49 UTC 2011


#1226: V4 packet library - packet parsing
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:  tomek
  stephen                            |                Status:  reviewing
                       Type:  task   |             Milestone:  Sprint-
                   Priority:  major  |  DHCP-20111026
                  Component:  dhcp   |            Resolution:
                   Keywords:         |             Sensitive:  0
            Defect Severity:  N/A    |           Sub-Project:  DHCP
Feature Depending on Ticket:         |  Estimated Difficulty:  0
        Add Hours to Ticket:  0      |           Total Hours:  0
                  Internal?:  0      |
-------------------------------------+-------------------------------------
Changes (by stephen):

 * owner:  UnAssigned => tomek


Comment:

 Reviewed commit 0fed56c3692e358184958cc1263cff67db0f62cb

 '''src/lib/asiolink/io_address.cc'''[[BR]]
 Any reason why a static IOAddress method is used to create an IOAddress
 rather than have a constructor take a uint32_t? (I see that from_bytes()
 also does that and I'm puzzled by that as well.)

 In the Jabber room although I suggested the uint32_t conversion operator,
 I then had second thoughts: if the IOAddress were only holding a V4
 address, a conversion operator would be fine.  But because it can hold a
 V6 address and because conversions are implicit it would be possible to
 have an apparently correct statement generate an exception for no
 discernible reason.  For this reason, perhaps a toUint32() method to
 return the address as a uint32_t would be better?

 '''src/lib/asiolink/pkt4.h'''[[BR]]
 Header of getBuffer() needs to make it clear that the returned output
 buffer is valid only while the Pkt4 object is valid.

 The buffer returned by getBuffer() should be "const" (else it is possible
 to modify the internals of the Pkt4 object without going through one of
 the defined interfaces.  Similarly, the method getBuffer() should also be
 const.

 Not related to this change, but the various Pkt4::getXxxx() methods should
 be "const" as they don't change the contents of the Pkt4 object.

 '''src/lib/dhcp/tests/pkt4_unittest.cc'''[[BR]]
 Declaration of "const static" variables: the "static" is not needed as by
 default, "const"s (and "typedef"s) have internal linkage.

 fixedFieldsPack test: Still declaring variables as "type * name" instead
 of "type* name" :-)

-- 
Ticket URL: <http://bind10.isc.org/ticket/1226#comment:4>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list