]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- A bug was repaired where MAC Address Affinity for virgin leases always
authorDavid Hankins <dhankins@isc.org>
Thu, 27 Sep 2007 15:28:05 +0000 (15:28 +0000)
committerDavid Hankins <dhankins@isc.org>
Thu, 27 Sep 2007 15:28:05 +0000 (15:28 +0000)
  mapped to the primary.  Virgin leases now have an interleaved preference
  between primary and secondary. [ISC-Bugs #17174]

- A bug was repaired where MAC Address Affinity for clients with no client
  identifier was sometimes mishashed to the peer.  Load balancing during
  runtime and pool rebalancing were opposing. [ISC-Bugs #17174]

RELNOTES
server/failover.c

index a6a7eb44ff090198063707a637200ebd291a2579..8464f4535d855f9bc1c79df280d07f4a802930d4 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -213,6 +213,16 @@ suggested fixes to <dhcp-users@isc.org>.
   were transmitted to it, and what frames are being carried through it which
   it should not intercept.
 
+                       Changes since 3.1.0 (Maintenance)
+
+- A bug was repaired where MAC Address Affinity for virgin leases always
+  mapped to the primary.  Virgin leases now have an interleaved preference
+  between primary and secondary.
+
+- A bug was repaired where MAC Address Affinity for clients with no client
+  identifier was sometimes mishashed to the peer.  Load balancing during
+  runtime and pool rebalancing were opposing.
+
                        Changes since 3.1.0rc1
 
 - The parse warning that 'deny dyanmic bootp;' must be configured for
index a2b270049fa7ede28b68d62d44267d05370cced8..8371955458a94336985d0c42842d2f85439450e4 100644 (file)
@@ -5502,10 +5502,18 @@ peer_wants_lease(struct lease *lp)
                return 0;
 
        if (lp->uid_len)
-               hbaix = loadb_p_hash (lp->uid, lp->uid_len);
-       else
-               hbaix = loadb_p_hash (lp->hardware_addr.hbuf,
-                                     lp->hardware_addr.hlen);
+               hbaix = loadb_p_hash(lp->uid, lp->uid_len);
+       else if (lp->hardware_addr.hlen > 1)
+               /* Skip the first byte, which is the hardware type, and is
+                * not included during actual load balancing checks above
+                * since it is separate from the packet header chaddr field.
+                * The remainder of the hardware address should be identical
+                * to the chaddr contents.
+                */
+               hbaix = loadb_p_hash(lp->hardware_addr.hbuf + 1,
+                                    lp->hardware_addr.hlen - 1);
+       else /* Consistent 50/50 split */
+               return(lp->ip_addr.iabuf[lp->ip_addr.len-1] & 0x01);
 
        hm = state->hba[(hbaix >> 3) & 0x1F] & (1 << (hbaix & 0x07));