struct interface *iface = state->interface;
struct dhcp_lease *lease = &state->lease;
struct in_addr addr;
+#ifdef ENABLE_CLIENTID
size_t len = 0;
+#endif
#ifdef ENABLE_DUID
unsigned char *duid = NULL;
uint32_t ul;
iface->net.s_addr = lease->net.s_addr;
}
+#ifdef ENABLE_CLIENTID
if (*options->clientid) {
/* Attempt to see if the ClientID is a hardware address */
if ((len = hwaddr_aton(NULL, options->clientid))) {
memcpy(iface->clientid + 2, iface->hwaddr, iface->hwlen);
}
}
+#endif
return 0;
}
# ifndef DISABLE_ARP
# define DISABLE_ARP
# endif
+# ifndef DISABLE_CLIENTID
+# define DISABLE_CLIENTID
+# endif
# ifndef DISABLE_IPV4LL
# define DISABLE_IPV4LL
# endif
# define ENABLE_ARP
#endif
+/* Send a ClientID in all messages. */
+#ifndef DISABLE_CLIENTID
+# define ENABLE_CLIENTID
+#endif
+
+/* Allow dhcpcd to create a DUID (LLT) and use it to make an IAID for the
+ * ClientID. Even enabled here, we need a config directive to actually use it
+ * so this toggle is just to remove it from dhcpcd to make the binary smaller.
+ * You can always create your own DUID file that just contains the
+ * hex string that represents the DUID.
+ * See RFC 3315 for details on this. */
+#ifndef DISABLE_DUID
+# ifdef ENABLE_CLIENTID
+# define ENABLE_DUID
+# endif
+#endif
+
/* IPV4LL, aka ZeroConf, aka APIPA, aka RFC 3927.
* Needs ARP. */
#ifndef DISABLE_IPV4LL
*/
// #define ENABLE_IPV4LL_ALWAYSROUTE
-/* Allow dhcpcd to create a DUID (LLT) and use it to make an IAID for the
- * ClientID. Even enabled here, we need a config directive to actually use it
- * so this toggle is just to remove it from dhcpcd to make the binary smaller.
- * You can always create your own DUID file that just contains the
- * hex string that represents the DUID.
- * See RFC 3315 for details on this. */
-#ifndef DISABLE_DUID
-# define ENABLE_DUID
-#endif
-
/* Allow dhcpcd to send user class options. */
#ifndef DISABLE_USERCLASS
# define ENABLE_USERCLASS
options->options &= ~DHCPCD_GATEWAY;
break;
case 'I':
+#ifdef ENABLE_CLIENTID
if (oarg) {
if (olen >= CLIENTID_MAX_LEN) {
logger(LOG_ERR, "`%s' is too long for"
options->options &= ~DHCPCD_DUID;
options->options &= ~DHCPCD_CLIENTID;
}
+#endif
break;
case 'K':
options->options &= ~DHCPCD_DAEMONISE;
options->classid[0] = snprintf((char *)options->classid + 1, CLASSID_MAX_LEN,
"%s %s", PACKAGE, VERSION);
- options->options |= DHCPCD_GATEWAY | DHCPCD_DAEMONISE | DHCPCD_CLIENTID;
+ options->options |= DHCPCD_GATEWAY | DHCPCD_DAEMONISE;
#ifdef ENABLE_ARP
options->options |= DHCPCD_ARP;
#ifdef ENABLE_IPV4LL
options->options |= DHCPCD_IPV4LL;
#endif
#endif
-
+#ifdef ENABLE_CLIENTID
+ options->options |= DHCPCD_CLIENTID;
+#endif
options->timeout = DEFAULT_TIMEOUT;
#ifdef CMDLINE_COMPAT
#ifdef ENABLE_ARP
" ARP"
#endif
+#ifdef ENABLE_CLIENTID
+ " CLIENTID"
+#endif
#ifdef ENABLE_DUID
" DUID"
#endif
#ifdef ENABLE_IPV4LL
" IPV4LL"
#endif
+#ifdef ENABLE_USERCLASS
+ " USERCLASS"
+#endif
#ifdef ENABLE_VENDOR
" VENDOR"
#endif
char hostname[MAXHOSTNAMELEN];
int fqdn;
uint8_t classid[CLASSID_MAX_LEN + 1];
+#ifdef ENABLE_CLIENTID
char clientid[CLIENTID_MAX_LEN + 1];
+#endif
#ifdef ENABLE_USERCLASS
uint8_t userclass[USERCLASS_MAX_LEN + 1];
#endif