]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- The Load Balance Algorithm was misimplemented. The current implementation
authorDavid Hankins <dhankins@isc.org>
Thu, 4 May 2006 21:14:21 +0000 (21:14 +0000)
committerDavid Hankins <dhankins@isc.org>
Thu, 4 May 2006 21:14:21 +0000 (21:14 +0000)
  matches RFC 3074. [ISC-Bugs #15980]

RELNOTES
server/failover.c

index d8287aa8f0e73cc3a55ee929bea066aedbdabf40..7bdfe7e66cced5b53acda11f8a8f0df7af6103e8 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -71,6 +71,9 @@ and for prodding me into improving it.
   were tranmsitted to it, and what frames are being carried through it which
   it should not intercept.
 
+- The Load Balance Algorithm was misimplemented.  The current implementation
+  matches RFC 3074.
+
                        Changes since 3.0.4b2
 
 - Null-termination sensing for certain clients that unfortunatley require
index bffd06f3297dab7607fd23c9778c46db7674dc69..7726a844730cfa35d3c1b3544fa36f4299ebf4f4 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: failover.c,v 1.60 2006/04/27 17:26:42 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: failover.c,v 1.61 2006/05/04 21:14:21 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -5233,7 +5233,9 @@ int load_balance_mine (struct packet *packet, dhcp_failover_state_t *state)
                hbaix = loadb_p_hash (packet -> raw -> chaddr,
                                      packet -> raw -> hlen);
        }
-       hm = (state -> hba [hbaix / 8] & (1 << (hbaix & 3)));
+
+       hm = state->hba[(hbaix >> 3) & 0x1F] & (1 << (hbaix & 0x07));
+
        if (state -> i_am == primary)
                return hm;
        else