summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Routhier <sar@isc.org>2013-12-13 12:40:45 -0800
committerShawn Routhier <sar@isc.org>2013-12-13 12:40:45 -0800
commit38ee81bd800bf5e59815e31d5cafff0d45a81bf1 (patch)
treef28ff155e895f5a299d703e247dc0b0ef6892744
parent61ef216b8dc05bc4245b61eee812038757d12ffe (diff)
downloadisc-dhcp-38ee81bd800bf5e59815e31d5cafff0d45a81bf1.tar.gz
[master] Patch to ignore UIDS
This patch adds an option to allow the administrator to tell the server to ignore UIDS when choosing a lease.
-rw-r--r--RELNOTES10
-rw-r--r--includes/dhcpd.h1
-rw-r--r--server/dhcp.c57
-rw-r--r--server/dhcpd.conf.513
-rw-r--r--server/stables.c3
5 files changed, 58 insertions, 26 deletions
diff --git a/RELNOTES b/RELNOTES
index 42f8c809..00aa4aad 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -109,6 +109,7 @@ work on other platforms. Please report any problems and suggested fixes to
man page for a description.
[ISC-Bugs #19598]
+<<<<<<< HEAD
- When doing DDNS if there isn't an appropriate zone statement attempt
to find a reasoanble nameserver via a DNS resolver. This restores
some functionality that was lost in the transition to asynchronous
@@ -122,6 +123,15 @@ work on other platforms. Please report any problems and suggested fixes to
"ddns-local-address4" and "ddns-local-address6" that each take
one instance of their respective address types.
[ISC-Bugs #34779]
+=======
+- Add ignore-client-uids option in the server. This option causes
+ the server to not record a client's uid in its lease. This
+ violates the specification but may also be useful when a client
+ can dual boot using different client ids but the same mac address.
+ Thank you to Brian De Wolf for the patch.
+ [ISC-Bugs #32427]
+ [ISC-Bugs #35066]
+>>>>>>> rt35066
Changes since 4.2.5
diff --git a/includes/dhcpd.h b/includes/dhcpd.h
index 32c2a89a..ed86ed44 100644
--- a/includes/dhcpd.h
+++ b/includes/dhcpd.h
@@ -735,6 +735,7 @@ struct lease_state {
#define SV_DONT_USE_FSYNC 79
#define SV_DDNS_LOCAL_ADDRESS4 80
#define SV_DDNS_LOCAL_ADDRESS6 81
+#define SV_IGNORE_CLIENT_UIDS 82
#if !defined (DEFAULT_PING_TIMEOUT)
# define DEFAULT_PING_TIMEOUT 1
diff --git a/server/dhcp.c b/server/dhcp.c
index 29ab5109..9d77530d 100644
--- a/server/dhcp.c
+++ b/server/dhcp.c
@@ -2343,31 +2343,40 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
/* Update Client Last Transaction Time. */
lt->cltt = cur_time;
- /* Record the uid, if given... */
- oc = lookup_option (&dhcp_universe, packet -> options,
- DHO_DHCP_CLIENT_IDENTIFIER);
- if (oc &&
- evaluate_option_cache (&d1, packet, lease,
- (struct client_state *)0,
- packet -> options, state -> options,
- &lease -> scope, oc, MDL)) {
- if (d1.len <= sizeof lt -> uid_buf) {
- memcpy (lt -> uid_buf, d1.data, d1.len);
- lt -> uid = lt -> uid_buf;
- lt -> uid_max = sizeof lt -> uid_buf;
- lt -> uid_len = d1.len;
- } else {
- unsigned char *tuid;
- lt -> uid_max = d1.len;
- lt -> uid_len = d1.len;
- tuid = (unsigned char *)dmalloc (lt -> uid_max, MDL);
- /* XXX inelegant */
- if (!tuid)
- log_fatal ("no memory for large uid.");
- memcpy (tuid, d1.data, lt -> uid_len);
- lt -> uid = tuid;
+ /* See if we want to record the uid for this client */
+ oc = lookup_option(&server_universe, state->options,
+ SV_IGNORE_CLIENT_UIDS);
+ if ((oc == NULL) ||
+ !evaluate_boolean_option_cache(&ignorep, packet, lease, NULL,
+ packet->options, state->options,
+ &lease->scope, oc, MDL)) {
+
+ /* Record the uid, if given... */
+ oc = lookup_option (&dhcp_universe, packet -> options,
+ DHO_DHCP_CLIENT_IDENTIFIER);
+ if (oc &&
+ evaluate_option_cache(&d1, packet, lease, NULL,
+ packet->options, state->options,
+ &lease->scope, oc, MDL)) {
+ if (d1.len <= sizeof(lt->uid_buf)) {
+ memcpy(lt->uid_buf, d1.data, d1.len);
+ lt->uid = lt->uid_buf;
+ lt->uid_max = sizeof(lt->uid_buf);
+ lt->uid_len = d1.len;
+ } else {
+ unsigned char *tuid;
+ lt->uid_max = d1.len;
+ lt->uid_len = d1.len;
+ tuid = (unsigned char *)dmalloc(lt->uid_max,
+ MDL);
+ /* XXX inelegant */
+ if (!tuid)
+ log_fatal ("no memory for large uid.");
+ memcpy(tuid, d1.data, lt->uid_len);
+ lt->uid = tuid;
+ }
+ data_string_forget (&d1, MDL);
}
- data_string_forget (&d1, MDL);
}
if (host) {
diff --git a/server/dhcpd.conf.5 b/server/dhcpd.conf.5
index 5906c113..ed699cf4 100644
--- a/server/dhcpd.conf.5
+++ b/server/dhcpd.conf.5
@@ -2305,6 +2305,19 @@ are larger than the maximum number of relays (currently 32) indicate the
relay closest to the server independent of number.
.RE
.PP
+The
+.I ignore-client-uids
+statement
+.RS 0.25i
+.PP
+.B ignore-client-uids \fIflag\fB;\fR
+.PP
+If the \fIignore-client-uids\fR statement is present and has a value of
+\fItrue\fR or \fIon\fR, the UID for clients will not be recorded.
+If this statement is not present or has a value of \fIfalse\fR or
+\fIoff\fR, then client UIDs will be recorded.
+.RE
+.PP
The
.I infinite-is-reserved
statement
diff --git a/server/stables.c b/server/stables.c
index bac6f8dc..398f2e1c 100644
--- a/server/stables.c
+++ b/server/stables.c
@@ -268,10 +268,9 @@ static struct option server_options[] = {
#endif /* LDAP_CONFIGURATION */
{ "dhcp-cache-threshold", "B", &server_universe, 78, 1 },
{ "dont-use-fsync", "f", &server_universe, 79, 1 },
-
{ "ddns-local-address4", "I", &server_universe, 80, 1 },
{ "ddns-local-address6", "6", &server_universe, 81, 1 },
-
+ { "ignore-client-uids", "f", &server_universe, 82, 1 },
{ NULL, NULL, NULL, 0, 0 }
};