summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorThomas Markwalder <tmark@isc.org>2017-11-27 07:18:48 -0500
committerThomas Markwalder <tmark@isc.org>2017-11-27 07:18:48 -0500
commit3e985dbf1fe0ec0cc022e57c85d7d4f1d087f402 (patch)
tree55b97909026e7420b72c3ae67a2f69aa58452081 /server
parentc0a64ef0e4d894ea6201781c1e0e9db5818b3936 (diff)
downloadisc-dhcp-3e985dbf1fe0ec0cc022e57c85d7d4f1d087f402.tar.gz
[master] Disable load balancing when load balance max secs is 0
Merges in rt39669.
Diffstat (limited to 'server')
-rw-r--r--server/dhcpd.conf.54
-rw-r--r--server/failover.c11
2 files changed, 14 insertions, 1 deletions
diff --git a/server/dhcpd.conf.5 b/server/dhcpd.conf.5
index a5ab07e2..02f854a9 100644
--- a/server/dhcpd.conf.5
+++ b/server/dhcpd.conf.5
@@ -749,6 +749,10 @@ failover peers gets into a state where it is responding to failover
messages but not responding to some client requests, the other
failover peer will take over its client load automatically as the
clients retry.
+.PP
+It is possible to disable load balancing between peers by setting this
+value to 0 on both peers. Bear in mind that this means both peers will
+respond to all DHCPDISCOVERs or DHCPREQUESTs.
.RE
.PP
The
diff --git a/server/failover.c b/server/failover.c
index 6630660d..25e1b72b 100644
--- a/server/failover.c
+++ b/server/failover.c
@@ -76,11 +76,19 @@ void dhcp_failover_sanity_check() {
state->name);
fail_count++;
}
+
+ if (state->load_balance_max_secs == 0) {
+ log_info ("WARNING: load balancing will be disabled "
+ "for failover peer, %s, "
+ "because its load balance max secs is 0",
+ state->name);
+ }
}
if (fail_count) {
log_fatal ("Failover configuration sanity check failed");
}
+
}
void dhcp_failover_startup ()
@@ -5968,7 +5976,8 @@ int load_balance_mine (struct packet *packet, dhcp_failover_state_t *state)
}
#endif
- if (state->load_balance_max_secs < ec) {
+ if ((state->load_balance_max_secs == 0) ||
+ (state->load_balance_max_secs < ec)) {
return (1);
}