From 150cedd0a127a6c4dbd7af125c9325c7385fbdcc Mon Sep 17 00:00:00 2001 From: Ted Lemon Date: Tue, 2 May 2000 00:00:08 +0000 Subject: [PATCH] Add support for the load balancing portion of the failover protocol. --- server/dhcp.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/server/dhcp.c b/server/dhcp.c index f3f6b3ad..57774932 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.144 2000/04/08 01:15:50 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.145 2000/05/02 00:00:08 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -153,6 +153,28 @@ void dhcpdiscover (packet, ms_nulltp) } } +#if defined (FAILOVER_PROTOCOL) + log_info ("lease -> pool = %lx\n", (unsigned long)lease -> pool); + if (lease -> pool) { + log_info ("lease -> pool -> failover_peer = %lx\n", + (unsigned long)(lease -> pool -> failover_peer)); + + if (lease -> pool -> failover_peer) + log_info ("lease -> pool -> failover_peer -> hba =%lx", + (unsigned long)(lease -> pool + -> failover_peer -> hba)); + } + + /* Do load balancing if configured. */ + if (lease -> pool && + lease -> pool -> failover_peer && + lease -> pool -> failover_peer -> hba) { + if (!load_balance_mine (packet, + lease -> pool -> failover_peer)) + return; + } +#endif + /* If it's an expired lease, get rid of any bindings. */ if (lease -> ends < cur_time && lease -> scope.bindings) free_bindings (&lease -> scope, MDL);