2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 06:15:55 +00:00

- Be more verbose about bogus state transitions.

- Don't accidentally do the transition when we decide not to.
This commit is contained in:
Ted Lemon
2001-01-19 11:06:45 +00:00
parent f8f3494034
commit 54bdf6c75e

View File

@@ -3,7 +3,7 @@
Failover protocol support code... */ Failover protocol support code... */
/* /*
* Copyright (c) 1999-2000 Internet Software Consortium. * Copyright (c) 1999-2001 Internet Software Consortium.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
#ifndef lint #ifndef lint
static char copyright[] = static char copyright[] =
"$Id: failover.c,v 1.30 2000/11/28 23:27:20 mellon Exp $ Copyright (c) 1999-2000 The Internet Software Consortium. All rights reserved.\n"; "$Id: failover.c,v 1.31 2001/01/19 11:06:45 mellon Exp $ Copyright (c) 1999-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@@ -3953,9 +3953,15 @@ isc_result_t dhcp_failover_process_bind_update (dhcp_failover_state_t *state,
(lease, state, (lease, state,
msg -> binding_status)); msg -> binding_status));
if (new_binding_state != msg -> binding_status) { if (new_binding_state != msg -> binding_status) {
char outbuf [100];
snprintf (outbuf, sizeof outbuf,
"invalid state transition: %d to %d",
lease -> binding_state,
msg -> binding_status);
dhcp_failover_send_bind_ack dhcp_failover_send_bind_ack
(state, lease, msg, FTR_FATAL_CONFLICT, (state, lease,
"invalid binding state transition"); msg, FTR_FATAL_CONFLICT, outbuf);
goto out;
} }
} }
lt -> next_binding_state = new_binding_state; lt -> next_binding_state = new_binding_state;
@@ -3969,6 +3975,7 @@ isc_result_t dhcp_failover_process_bind_update (dhcp_failover_state_t *state,
reason, message); reason, message);
} else } else
dhcp_failover_send_bind_ack (state, lease, msg, 0, 0); dhcp_failover_send_bind_ack (state, lease, msg, 0, 0);
out:
if (lt) if (lt)
lease_dereference (&lt, MDL); lease_dereference (&lt, MDL);
if (lease) if (lease)