dhcpcd-3 enabled DUID support by default - this has changed in dhcpcd-4.
You can enable it via the --duid, -D command line option or by using the
duid directive in dhcpcd.conf.
+If CMDLINE_COMPAT is defined the we renable DUID support by default IF
+the dhcpcd.duid file exits. This keeps the clients working as they were,
+which is good.
dhcpcd-4 is NOT fully commandline compatible with dhcpcd-2 and older and
changes the meaning of some options.
DHCPCD_DAEMONISE | DHCPCD_CLIENTID;
options->timeout = DEFAULT_TIMEOUT;
+#ifdef CMDLINE_COMPAT
+ add_reqmask(options->reqmask, DHCP_DNSSERVER);
+ add_reqmask(options->reqmask, DHCP_DNSDOMAIN);
+ add_reqmask(options->reqmask, DHCP_DNSSEARCH);
+ add_reqmask(options->reqmask, DHCP_NISSERVER);
+ add_reqmask(options->reqmask, DHCP_NISDOMAIN);
+ add_reqmask(options->reqmask, DHCP_NTPSERVER);
+
+ /* If the duid file exists, then enable duid by default
+ * This means we don't break existing clients that easily :) */
+ if ((f = fopen(DUIDFILE, "r"))) {
+ options->options |= DHCPCD_DUID;
+ fclose(f);
+ }
+#endif
+
gethostname(options->hostname, sizeof(options->hostname));
if (strcmp(options->hostname, "(none)") == 0 ||
strcmp(options->hostname, "localhost") == 0)
}
}
-#ifdef CMDLINE_COMAPT
- add_reqmask(options->reqmask, DHCP_DNSSERVER);
- add_reqmask(options->reqmask, DHCP_DNSDOMAIN);
- add_reqmask(options->reqmask, DHCP_DNSSEARCH);
- add_reqmask(options->reqmask, DHCP_NISSERVER);
- add_reqmask(options->reqmask, DHCP_NISDOMAIN);
- add_reqmask(options->reqmask, DHCP_NTPSERVER);
-#endif
-
optind = 0;
while ((opt = getopt_long(argc, argv, OPTS EXTRA_OPTS,
longopts, &option_index)) != -1)