Commit bafa7b74 authored by Thomas Markwalder's avatar Thomas Markwalder

[master] Added --release-on-roam server parameter

    Merges in 46849.
parent e8b058cf
...@@ -184,19 +184,26 @@ dhcp-users@lists.isc.org. ...@@ -184,19 +184,26 @@ dhcp-users@lists.isc.org.
doing load balancing within failover. doing load balancing within failover.
[ISC-Bugs #45364] [ISC-Bugs #45364]
- If the server detects that a DHCPv6 client (IAID+DUID) has roamed to a new - Added --release-on-roam to dhcpd server. When enabled and the server detects
network, it will now automatically release pre-existing leases on the old that a DHCPv6 client (IAID+DUID) has roamed to a new network, it will release
network. When this occurs the server will emit a log statement: 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>" "Client: <id> roamed to new network, releasing lease: <address>"
The server will carry out all of the same steps that would normally occur 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 when a client explicitly releases a lease. This behavior is disabled by
dropped the pre-existing leases on the floor without doing the appropriate default and may only be specified globally. Prior to this the server renders
clean-up. Clients that need leases in multiple networks must supply a the leases unavailable until they expire or the server is restarted. Clients
unique IAID in each IA. Thanks to Fernando Soto from BlueCat Networks for that need leases in multiple networks must supply a unique IAID in each IA.
reporting the issue. 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 #44576]
[ISC-Bugs #46849]
- The ability of the server to send back dhcp6.vendor-opts values has been - 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 restored. A change in 4.3.5 (see #29246) which enabled it to send back the
......
...@@ -809,6 +809,7 @@ struct lease_state { ...@@ -809,6 +809,7 @@ struct lease_state {
#define SV_DDNS_DUAL_STACK_MIXED_MODE 92 #define SV_DDNS_DUAL_STACK_MIXED_MODE 92
#define SV_DDNS_GUARD_ID_MUST_MATCH 93 #define SV_DDNS_GUARD_ID_MUST_MATCH 93
#define SV_DDNS_OTHER_GUARD_IS_DYNAMIC 94 #define SV_DDNS_OTHER_GUARD_IS_DYNAMIC 94
#define SV_RELEASE_ON_ROAM 95
#if !defined (DEFAULT_PING_TIMEOUT) #if !defined (DEFAULT_PING_TIMEOUT)
# define DEFAULT_PING_TIMEOUT 1 # define DEFAULT_PING_TIMEOUT 1
...@@ -2104,7 +2105,11 @@ extern int server_id_check; ...@@ -2104,7 +2105,11 @@ extern int server_id_check;
extern int persist_eui64; extern int persist_eui64;
#endif #endif
#ifdef DHCPv6
extern int prefix_length_mode; extern int prefix_length_mode;
extern int do_release_on_roam;
#endif
extern int authoring_byte_order; extern int authoring_byte_order;
extern int lease_id_format; extern int lease_id_format;
extern u_int32_t abandon_lease_time; extern u_int32_t abandon_lease_time;
......
...@@ -80,7 +80,11 @@ u_int16_t ddns_conflict_mask; ...@@ -80,7 +80,11 @@ u_int16_t ddns_conflict_mask;
int ddns_update_style; int ddns_update_style;
int dont_use_fsync = 0; /* 0 = default, use fsync, 1 = don't use fsync */ 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 */ int server_id_check = 0; /* 0 = default, don't check server id, 1 = do check */
#ifdef DHCPv6
int prefix_length_mode = PLM_PREFER; 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 #ifdef EUI_64
int persist_eui64 = 1; /* 1 = write EUI64 leases to disk, 0 = don't */ int persist_eui64 = 1; /* 1 = write EUI64 leases to disk, 0 = don't */
...@@ -1365,6 +1369,7 @@ void postconf_initialization (int quiet) ...@@ -1365,6 +1369,7 @@ void postconf_initialization (int quiet)
server_id_check = 1; server_id_check = 1;
} }
#ifdef DHCPv6
oc = lookup_option(&server_universe, options, SV_PREFIX_LEN_MODE); oc = lookup_option(&server_universe, options, SV_PREFIX_LEN_MODE);
if ((oc != NULL) && if ((oc != NULL) &&
evaluate_option_cache(&db, NULL, NULL, NULL, options, NULL, evaluate_option_cache(&db, NULL, NULL, NULL, options, NULL,
...@@ -1377,6 +1382,7 @@ void postconf_initialization (int quiet) ...@@ -1377,6 +1382,7 @@ void postconf_initialization (int quiet)
data_string_forget(&db, MDL); data_string_forget(&db, MDL);
} }
#endif
// Set global abandon-lease-time option. // Set global abandon-lease-time option.
oc = lookup_option (&server_universe, options, SV_ABANDON_LEASE_TIME); oc = lookup_option (&server_universe, options, SV_ABANDON_LEASE_TIME);
...@@ -1416,6 +1422,16 @@ void postconf_initialization (int quiet) ...@@ -1416,6 +1422,16 @@ void postconf_initialization (int quiet)
} }
#endif #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 defined (BINARY_LEASES)
if (local_family == AF_INET) { if (local_family == AF_INET) {
log_info("Source compiled to use binary-leases"); log_info("Source compiled to use binary-leases");
......
...@@ -3116,6 +3116,27 @@ starting with pool A but with appropriately adjusted length criteria. ...@@ -3116,6 +3116,27 @@ starting with pool A but with appropriately adjusted length criteria.
.RE .RE
.PP .PP
The 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 .I remote-port
statement statement
.RS 0.25i .RS 0.25i
......
...@@ -8400,7 +8400,8 @@ release_on_roam(struct reply_state* reply) { ...@@ -8400,7 +8400,8 @@ release_on_roam(struct reply_state* reply) {
struct iasubopt *lease = NULL; struct iasubopt *lease = NULL;
int i; 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); return(0);
} }
......
...@@ -287,6 +287,7 @@ static struct option server_options[] = { ...@@ -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-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-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 }, { "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 } { NULL, NULL, NULL, 0, 0 }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment