untrusted comment: signature from openbsd 6.1 base secret key
RWQEQa33SgQSEuw6NAI/fUirbbPUt3WKyoNeyz/Iz9dvDK+fzK1k7X4XeS44XTJ4+LsNRZu/XrYl0GbqT90DbTCdcRn+f0egSQU=
OpenBSD 6.1 errata 001, May 2, 2017:
dhcpd(8) unconditionally echoed client identifier. Add parameter
"echo-client-id" to allow this behaviour to be turned off.
/* If we're already acking this lease, don't do it again. */
if (lease->state) {
@@ -1239,8 +1239,16 @@ ack_lease(struct packet *packet, struct
memset(&state->options[i], 0, sizeof(state->options[i]));
/* Echo back the client-identifier as RFC 6842 mandates. */
+ if (lease->host)
+ echo_client_id = lease->host->group->echo_client_id;
+ else if (user_class)
+ echo_client_id = user_class->group->echo_client_id;
+ else if (vendor_class)
+ echo_client_id = vendor_class->group->echo_client_id;
+ else
+ echo_client_id = lease->subnet->group->echo_client_id;
i = DHO_DHCP_CLIENT_IDENTIFIER;
- if (lease->client_identifier) {
+ if (lease->client_identifier && echo_client_id) {
state->options[i] = new_tree_cache("dhcp-client-identifier");
state->options[i]->flags = TC_TEMPORARY;
state->options[i]->value = lease->client_identifier;
Index: usr.sbin/dhcpd/dhcpd.conf.5
===================================================================
RCS file: /cvs/src/usr.sbin/dhcpd/dhcpd.conf.5,v
retrieving revision 1.18
diff -u -p -r1.18 dhcpd.conf.5
--- usr.sbin/dhcpd/dhcpd.conf.5 4 Feb 2017 22:21:57 -0000 1.18
+++ usr.sbin/dhcpd/dhcpd.conf.5 20 Apr 2017 14:36:38 -0000
@@ -919,6 +919,23 @@ Supplying a value for the
option is equivalent to using the
.Ic server-identifier
statement.
+.Pp
+The
+.Ic echo-client-id
+statement
+.Pp
+.D1 Ic echo-client-id Ar flag ;
+.Pp
+is used to enable or disable RFC 6842 compliant behavior.
+If the
+.Ic echo-client-id
+statement is present and has a
+value of true or on, and a DHCP DISCOVER or REQUEST is received which contains
+the client identifier option (Option code 61), the server will copy the option
+into its response (DHCP ACK or NAK) per RFC 6842.
+In other words if the client sends the option it will receive it back.
+By default, this flag is on
+and client identifiers will be echoed back to the client.
.Sh REFERENCE: OPTION STATEMENTS
DHCP option statements are documented in the
.Xr dhcp-options 5
Index: usr.sbin/dhcpd/dhcpd.h
===================================================================
RCS file: /cvs/src/usr.sbin/dhcpd/dhcpd.h,v
retrieving revision 1.63
diff -u -p -r1.63 dhcpd.h
--- usr.sbin/dhcpd/dhcpd.h 18 Apr 2017 13:59:09 -0000 1.63
+++ usr.sbin/dhcpd/dhcpd.h 20 Apr 2017 13:26:31 -0000
@@ -223,6 +223,7 @@ struct group {
int use_lease_addr_for_default_route;
int authoritative;
int always_reply_rfc1048;
+ int echo_client_id;