summaryrefslogtreecommitdiff
path: root/server
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 /server
parente8b058cfa5bc027201f8d9924e419964e5c1e0ac (diff)
downloadisc-dhcp-bafa7b74c4b136f913d4d7b4d1a192bfd6ceb3ed.tar.gz
[master] Added --release-on-roam server parameter
Merges in 46849.
Diffstat (limited to 'server')
-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
4 files changed, 40 insertions, 1 deletions
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 }
};