From 0b17f049ed230a77ecb32330533013a1b9fb5dc8 Mon Sep 17 00:00:00 2001 From: David Hankins Date: Thu, 4 May 2006 21:14:21 +0000 Subject: [PATCH] - The Load Balance Algorithm was misimplemented. The current implementation matches RFC 3074. [ISC-Bugs #15980] --- RELNOTES | 3 +++ server/failover.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/RELNOTES b/RELNOTES index d8287aa8f..7bdfe7e66 100644 --- 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 diff --git a/server/failover.c b/server/failover.c index bffd06f32..7726a8447 100644 --- a/server/failover.c +++ b/server/failover.c @@ -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 -- 2.39.5