--- embedaddon/dhcp/server/failover.c 2012/02/21 22:30:18 1.1 +++ embedaddon/dhcp/server/failover.c 2012/10/09 09:06:55 1.1.1.1 @@ -3,7 +3,7 @@ Failover protocol support code... */ /* - * Copyright (c) 2011 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 2011-2012 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 2004-2009 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 1999-2003 by Internet Software Consortium * @@ -33,6 +33,7 @@ * ``http://www.nominum.com''. */ +#include "cdefs.h" #include "dhcpd.h" #include @@ -2384,7 +2385,8 @@ dhcp_failover_pool_dobalance(dhcp_failover_state_t *st struct shared_network *s; struct pool *p; binding_state_t peer_lease_state; - binding_state_t my_lease_state; + /* binding_state_t my_lease_state; */ + /* XXX Why is this my_lease_state never used? */ struct lease **lq; int (*log_func)(const char *, ...); const char *result, *reqlog; @@ -2408,12 +2410,12 @@ dhcp_failover_pool_dobalance(dhcp_failover_state_t *st if (p->failover_peer->i_am == primary) { lts = (p->free_leases - p->backup_leases) / 2; peer_lease_state = FTS_BACKUP; - my_lease_state = FTS_FREE; + /* my_lease_state = FTS_FREE; */ lq = &p->free; } else { lts = (p->backup_leases - p->free_leases) / 2; peer_lease_state = FTS_FREE; - my_lease_state = FTS_BACKUP; + /* my_lease_state = FTS_BACKUP; */ lq = &p->backup; } @@ -3218,12 +3220,10 @@ isc_result_t dhcp_failover_state_stuff (omapi_object_t omapi_object_t *h) { dhcp_failover_state_t *s; - omapi_connection_object_t *conn; isc_result_t status; if (c -> type != omapi_type_connection) return ISC_R_INVALIDARG; - conn = (omapi_connection_object_t *)c; if (h -> type != dhcp_type_failover_state) return ISC_R_INVALIDARG; @@ -4266,6 +4266,8 @@ void dhcp_failover_send_contact (void *vstate) if (obufix) { log_debug ("%s", obuf); } +#else + IGNORE_UNUSED(status); #endif return; } @@ -4314,6 +4316,8 @@ isc_result_t dhcp_failover_send_state (dhcp_failover_s if (obufix) { log_debug ("%s", obuf); } +#else + IGNORE_UNUSED(status); #endif return ISC_R_SUCCESS; } @@ -4450,7 +4454,6 @@ isc_result_t dhcp_failover_send_disconnect (omapi_obje const char *message) { dhcp_failover_link_t *link; - dhcp_failover_state_t *state; isc_result_t status; #if defined (DEBUG_FAILOVER_MESSAGES) char obuf [64]; @@ -4465,7 +4468,6 @@ isc_result_t dhcp_failover_send_disconnect (omapi_obje if (!l || l -> type != dhcp_type_failover_link) return ISC_R_INVALIDARG; link = (dhcp_failover_link_t *)l; - state = link -> state_object; if (!l -> outer || l -> outer -> type != omapi_type_connection) return ISC_R_INVALIDARG;