]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[master] Merge branch 'trac2327' (DHCPv6 lease expiration)
authorTomek Mrugalski <tomasz@isc.org>
Wed, 19 Dec 2012 11:29:34 +0000 (12:29 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Wed, 19 Dec 2012 11:29:34 +0000 (12:29 +0100)
Conflicts:
ChangeLog
src/lib/dhcpsrv/alloc_engine.cc

1  2 
ChangeLog
src/bin/dhcp6/tests/dhcp6_srv_unittest.cc
src/lib/dhcpsrv/alloc_engine.cc

diff --cc ChangeLog
index a418708440d0bd5c9756944f50b4f66c8de48f81,b2f1ae7134f88d004f3c6c3518116525758bac03..977b6ea7e636a262e108c1a1acaa15383de3866a
+++ b/ChangeLog
@@@ -1,44 -1,8 +1,50 @@@
 -5XX.  [func]          tomek
++531.  [func]          tomek
+       b10-dhcp6: Added support for expired leases. Leases for IPv6
+       addresses that are past their valid lifetime may be recycled, i.e.
+       rellocated to other clients if needed.
 -      (Trac #2327, git TBD)
++      (Trac #2327, git 62a23854f619349d319d02c3a385d9bc55442d5e)
++
 +530.  [func]*         team
 +      b10-loadzone was fully overhauled.  It now uses C++-based zone
 +      parser and loader library, performing stricter checks, having
 +      more complete support for master file formats, producing more
 +      helpful logs, is more extendable for various types of data
 +      sources, and yet much faster than the old version.  In
 +      functionality the new version should be generally backwards
 +      compatible to the old version, but there are some
 +      incompatibilities: name fields of RDATA (in NS, SOA, etc) must
 +      be absolute for now; due to the stricter checks some input that was
 +      (incorrectly) accepted by the old version may now be rejected;
 +      command line options and arguments are not compatible.
 +      (Trac #2380, git 689b015753a9e219bc90af0a0b818ada26cc5968)
 +
 +529.  [func]*         team
 +      The in-memory data source now uses a more complete master file
 +      parser to load textual zone files.  As of this change it supports
 +      multi-line RR representation and more complete support for escaped
 +      and quoted strings.  It also produces more helpful log when there
 +      is an error in the zone file.  It will be enhanced as more
 +      specific tasks in the #2368 meta ticket are completed.  The new
 +      parser is generally upper compatible to the previous one, but due
 +      to the tighter checks some input that has been accepted so far
 +      could now be rejected, so it's advisable to check if you use
 +      textual zone files directly loaded to memory.
 +      (Trac #2470, git c4cf36691115c15440b65cac16f1c7fcccc69521)
 +
 +528.  [func]          marcin
 +      Implemented definitions for DHCPv4 option definitions identified
 +      by option codes: 1 to 63, 77, 81-82, 90-92, 118-119, 124-125.
 +      These definitions are now used by the DHCPv4 server to parse
 +      options received from a client.
 +      (Trac #2526, git 50a73567e8067fdbe4405b7ece5b08948ef87f98)
 +
 +527.  [bug]           jelte
 +      Fixed a bug in the synchronous UDP server code where unexpected
 +      errors from ASIO or the system libraries could cause b10-auth to
 +      stop. In asynchronous mode these errors would be ignored
 +      completely. Both types have been updated to report the problem with
 +      an ERROR log message, drop the packet, and continue service.
 +      (Trac #2494, git db92f30af10e6688a7dc117b254cb821e54a6d95)
  
  526.  [bug]           stephen
        Miscellaneous fixes to DHCP code including rationalisation of
index 452343cb2e885100ee99bd48b3c528868b705c58,1a2a057ac347fd7ca83256af5f28e47e3d0deb53..1c64c04f3b52545c49d8b9271a35561228da5e6a
@@@ -30,23 -30,24 +30,24 @@@ AllocEngine::IterativeAllocator::Iterat
  
  isc::asiolink::IOAddress
  AllocEngine::IterativeAllocator::increaseAddress(const isc::asiolink::IOAddress& addr) {
 +    // Get a buffer holding an address.
 +    const std::vector<uint8_t>& vec = addr.toBytes();
 +    // Get the address length.
 +    const int len = vec.size();
 +
 +    // Since the same array will be used to hold the IPv4 and IPv6
 +    // address we have to make sure that the size of the array
 +    // we allocate will work for both types of address.
 +    BOOST_STATIC_ASSERT(V4ADDRESS_LEN <= V6ADDRESS_LEN);
      uint8_t packed[V6ADDRESS_LEN];
 -    int len;
  
 -    // First we copy the whole address as 16 bytes.
 -    if (addr.getFamily()==AF_INET) {
 -        // IPv4
 -        std::memcpy(packed, addr.getAddress().to_v4().to_bytes().data(), 4);
 -        len = 4;
 -    } else {
 -        // IPv6
 -        std::memcpy(packed, addr.getAddress().to_v6().to_bytes().data(), 16);
 -        len = 16;
 -    }
 +    // Copy the address. It can be either V4 or V6.
 +    std::memcpy(packed, &vec[0], len);
  
-     // Increase the address.
+     // Start increasing the least significant byte
      for (int i = len - 1; i >= 0; --i) {
          ++packed[i];
+         // if we haven't overflowed (0xff -> 0x0), than we are done
          if (packed[i] != 0) {
              break;
          }