summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Markwalder <tmark@isc.org>2017-12-18 14:00:46 -0500
committerThomas Markwalder <tmark@isc.org>2017-12-18 14:00:46 -0500
commitbafa7b74c4b136f913d4d7b4d1a192bfd6ceb3ed (patch)
treede3169a9d2e4db9385ac35925f02a960487eb307
parente8b058cfa5bc027201f8d9924e419964e5c1e0ac (diff)
downloadisc-dhcp-bafa7b74c4b136f913d4d7b4d1a192bfd6ceb3ed.tar.gz
[master] Added --release-on-roam server parameter
Merges in 46849.
-rw-r--r--RELNOTES23
-rw-r--r--includes/dhcpd.h5
-rw-r--r--server/dhcpd.c16
-rw-r--r--server/dhcpd.conf.521
-rw-r--r--server/dhcpv6.c3
-rw-r--r--server/stables.c1
6 files changed, 60 insertions, 9 deletions
diff --git a/RELNOTES b/RELNOTES
index feab3810..22ac72b0 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -184,19 +184,26 @@ dhcp-users@lists.isc.org.
doing load balancing within failover.
[ISC-Bugs #45364]
-- If the server detects that a DHCPv6 client (IAID+DUID) has roamed to a new
- network, it will now automatically release pre-existing leases on the old
- network. When this occurs the server will emit a log statement:
+- Added --release-on-roam to dhcpd server. When enabled and the server detects
+ that a DHCPv6 client (IAID+DUID) has roamed to a new network, it will release
+ the pre-existing leases on the old network and emit a log statement similar
+ to the following:
"Client: <id> roamed to new network, releasing lease: <address>"
The server will carry out all of the same steps that would normally occur
- when a client explicitly releases a lease. Prior to this the server simply
- dropped the pre-existing leases on the floor without doing the appropriate
- clean-up. Clients that need leases in multiple networks must supply a
- unique IAID in each IA. Thanks to Fernando Soto from BlueCat Networks for
- reporting the issue.
+ when a client explicitly releases a lease. This behavior is disabled by
+ default and may only be specified globally. Prior to this the server renders
+ the leases unavailable until they expire or the server is restarted. Clients
+ that need leases in multiple networks must supply a unique IAID in each IA.
+ When release-on-roam is disabled (the default) the server maintains the
+ prior behavior of making such leases unavailable until they expire or the
+ server is restarted. Clients that need leases in multiple networks must
+ supply a unique IAID in each IA. This parameter may only be specified at
+ the global level. Thanks to Fernando Soto from BlueCat Networks for
+ suggesting this change.
[ISC-Bugs #44576]
+ [ISC-Bugs #46849]
- The ability of the server to send back dhcp6.vendor-opts values has been
restored. A change in 4.3.5 (see #29246) which enabled it to send back the
diff --git a/includes/dhcpd.h b/includes/dhcpd.h
index 43abe288..95af8a21 100644
--- a/includes/dhcpd.h
+++ b/includes/dhcpd.h
@@ -809,6 +809,7 @@ struct lease_state {
#define SV_DDNS_DUAL_STACK_MIXED_MODE 92
#define SV_DDNS_GUARD_ID_MUST_MATCH 93
#define SV_DDNS_OTHER_GUARD_IS_DYNAMIC 94
+#define SV_RELEASE_ON_ROAM 95
#if !defined (DEFAULT_PING_TIMEOUT)
# define DEFAULT_PING_TIMEOUT 1
@@ -2104,7 +2105,11 @@ extern int server_id_check;
extern int persist_eui64;
#endif
+#ifdef DHCPv6
extern int prefix_length_mode;
+extern int do_release_on_roam;
+#endif
+
extern int authoring_byte_order;
extern int lease_id_format;
extern u_int32_t abandon_lease_time;
diff --git a/server/dhcpd.c b/server/dhcpd.c
index 614bc097..c5b9d092 100644
--- a/server/dhcpd.c
+++ b/server/dhcpd.c
@@ -80,7 +80,11 @@ u_int16_t ddns_conflict_mask;
int ddns_update_style;
int dont_use_fsync = 0; /* 0 = default, use fsync, 1 = don't use fsync */
int server_id_check = 0; /* 0 = default, don't check server id, 1 = do check */
+
+#ifdef DHCPv6
int prefix_length_mode = PLM_PREFER;
+int do_release_on_roam = 0; /* 0 = default, do not release v6 leases on roam */
+#endif
#ifdef EUI_64
int persist_eui64 = 1; /* 1 = write EUI64 leases to disk, 0 = don't */
@@ -1365,6 +1369,7 @@ void postconf_initialization (int quiet)
server_id_check = 1;
}
+#ifdef DHCPv6
oc = lookup_option(&server_universe, options, SV_PREFIX_LEN_MODE);
if ((oc != NULL) &&
evaluate_option_cache(&db, NULL, NULL, NULL, options, NULL,
@@ -1377,6 +1382,7 @@ void postconf_initialization (int quiet)
data_string_forget(&db, MDL);
}
+#endif
// Set global abandon-lease-time option.
oc = lookup_option (&server_universe, options, SV_ABANDON_LEASE_TIME);
@@ -1416,6 +1422,16 @@ void postconf_initialization (int quiet)
}
#endif
+#ifdef DHCPv6
+ oc = lookup_option(&server_universe, options, SV_RELEASE_ON_ROAM);
+ if (oc != NULL) {
+ do_release_on_roam =
+ evaluate_boolean_option_cache(NULL, NULL, NULL, NULL,
+ options, NULL,
+ &global_scope, oc, MDL);
+ }
+#endif
+
#if defined (BINARY_LEASES)
if (local_family == AF_INET) {
log_info("Source compiled to use binary-leases");
diff --git a/server/dhcpd.conf.5 b/server/dhcpd.conf.5
index f2b6fa49..7244fa7c 100644
--- a/server/dhcpd.conf.5
+++ b/server/dhcpd.conf.5
@@ -3116,6 +3116,27 @@ starting with pool A but with appropriately adjusted length criteria.
.RE
.PP
The
+.I release-on-roam
+statement
+.RS 0.25i
+.PP
+.B release-on-roam \fIflag\fB;\fR
+.PP
+When enabled and the dhcpd server detects that a DHCPv6 client (IAID+DUID)
+has roamed to a new network, it will release the pre-existing leases on the
+old network and emit a log statement similiar to the following:
+
+ "Client: <id> roamed to new network, releasing lease: <address>"
+
+The server will carry out all of the same steps that would normally occur
+when a client explicitly releases a lease. When release-on-roam is disabled
+(the default) the server makes such leases unavailable until they expire or
+the server is restarted. Clients that need leases in multiple networks must
+supply a unique IAID in each IA. This parameter may only be specified at
+the global level.
+.RE
+.PP
+The
.I remote-port
statement
.RS 0.25i
diff --git a/server/dhcpv6.c b/server/dhcpv6.c
index 4fdb2ceb..339766ea 100644
--- a/server/dhcpv6.c
+++ b/server/dhcpv6.c
@@ -8400,7 +8400,8 @@ release_on_roam(struct reply_state* reply) {
struct iasubopt *lease = NULL;
int i;
- if (old_ia == NULL || old_ia->num_iasubopt <= 0) {
+ if ((!do_release_on_roam) || old_ia == NULL
+ || old_ia->num_iasubopt <= 0) {
return(0);
}
diff --git a/server/stables.c b/server/stables.c
index 8a951b6a..e85696e1 100644
--- a/server/stables.c
+++ b/server/stables.c
@@ -287,6 +287,7 @@ static struct option server_options[] = {
{ "ddns-dual-stack-mixed-mode", "f", &server_universe, SV_DDNS_DUAL_STACK_MIXED_MODE, 1 },
{ "ddns-guard-id-must-match", "f", &server_universe, SV_DDNS_GUARD_ID_MUST_MATCH, 1 },
{ "ddns-other-guard-is-dynamic", "f", &server_universe, SV_DDNS_OTHER_GUARD_IS_DYNAMIC, 1 },
+ { "release-on-roam", "f", &server_universe, SV_RELEASE_ON_ROAM, 1 },
{ NULL, NULL, NULL, 0, 0 }
};