]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Add support for the load balancing portion of the failover protocol.
authorTed Lemon <source@isc.org>
Tue, 2 May 2000 00:00:08 +0000 (00:00 +0000)
committerTed Lemon <source@isc.org>
Tue, 2 May 2000 00:00:08 +0000 (00:00 +0000)
server/dhcp.c

index f3f6b3adcbc0a108765202ca7fd71bd7601da14a..57774932c93a957f6bd8b17e9d8e26e8cb4c8391 100644 (file)
@@ -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);