the dhcpcd.duid file exits. This keeps the clients working as they were,
which is good.
+dhcpcd no longer sends a default ClientID for ethernet interfaces.
+This is so we can re-use the address the kernel DHCP client found.
+To retain the old behaviour of sending a default ClientID based on the
+hardware address for interface, simply add the keyword clientid to dhcpcd.conf.
+If CMDLINE_COMPAT is defined, we renable the sending of ClientID by default
+AND adding clientid to dhcpcd.conf causes it NOT to be sent.
+
dhcpcd-4 is NOT fully commandline compatible with dhcpcd-2 and older and
changes the meaning of some options.
iface->net.s_addr = lease->net.s_addr;
}
+ /* If we haven't specified a ClientID and our hardware address
+ * length is greater than DHCP_CHADDR_LEN then we enforce a ClientID
+ * of the hardware address family and the hardware address. */
+ if (!(state->options & DHCPCD_CLIENTID) && iface->hwlen > DHCP_CHADDR_LEN)
+ state->options |= DHCPCD_CLIENTID;
+
if (*options->clientid) {
iface->clientid = xmalloc(options->clientid[0] + 1);
memcpy(iface->clientid,
options->clientid, options->clientid[0] + 1);
- } else if (options->options & DHCPCD_CLIENTID) {
- if (options->options & DHCPCD_DUID) {
+ } else if (state->options & DHCPCD_CLIENTID) {
+ if (state->options & DHCPCD_DUID) {
duid = xmalloc(DUID_LEN);
if ((len = get_duid(duid, iface)) == 0)
logger(LOG_ERR, "get_duid: %s",
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd August 20, 2008
+.Dd November 18, 2008
.Dt DHCPCD 8 SMM
.Sh NAME
.Nm dhcpcd
encodes the FQDN hostname as specified in
.Li RFC1035 .
.It Fl I , -clientid Ar clientid
-Change the default clientid sent from the interface hardware address.
+Send the
+.Ar clientid .
If the string is of the format 01:02:03 then it is encoded as hex.
-If not set then none is sent.
+For interfaces whose hardware address is longer than 8 bytes, or if the
+.Ar clientid
+is an empty string then
+.Nm
+sends a default
+.Ar clientid
+of the hardware family and the hardware address.
.El
.Ss Restriciting behaviour
.Nm
return -1;
}
options->clientid[0] = (uint8_t)s;
+#ifdef CMDLINE_COMPAT
if (s == 0) {
options->options &= ~DHCPCD_DUID;
options->options &= ~DHCPCD_CLIENTID;
}
+#else
+ options->options |= DHCPCD_CLIENTID;
+#endif
break;
case 'K':
options->options &= ~DHCPCD_LINK;
setlogprefix(PACKAGE ": ");
options = xzalloc(sizeof(*options));
- options->options |= DHCPCD_CLIENTID | DHCPCD_GATEWAY | DHCPCD_DAEMONISE;
+ options->options |= DHCPCD_GATEWAY | DHCPCD_DAEMONISE;
options->options |= DHCPCD_ARP | DHCPCD_IPV4LL | DHCPCD_LINK;
options->timeout = DEFAULT_TIMEOUT;
strlcpy(options->script, SCRIPT, sizeof(options->script));
"%s %s", PACKAGE, VERSION);
#ifdef CMDLINE_COMPAT
+ options->options |= DHCPCD_CLIENTID;
add_option_mask(options->requestmask, DHO_DNSSERVER);
add_option_mask(options->requestmask, DHO_DNSDOMAIN);
add_option_mask(options->requestmask, DHO_DNSSEARCH);
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd August 18, 2008
+.Dd November 18, 2008
.Dt DHCPCD.CONF 5 SMM
.Sh NAME
.Nm dhcpcd.conf
This is useful for startup scripts which don't disable link messages for
carrier status.
.It Ic clientid Ar string
-Change the default clientid sent from the interface hardware address.
+Send the
+.Ar clientid .
If the string is of the format 01:02:03 then it is encoded as hex.
-If not set then none is sent.
+For interfaces whose hardware address is longer than 8 bytes, or if the
+.Ar clientid
+is an empty string then
+.Nm dhcpcd
+sends a default
+.Ar clientid
+of the hardware family and the hardware address.
.It Ic duid
Generate an
.Rs