#include "configure.h"
#include "dhcp.h"
#include "dhcpcd.h"
-#ifdef ENABLE_INFO
-# include "info.h"
-#endif
#include "interface.h"
#include "logger.h"
#include "signals.h"
#include "socket.h"
+#ifdef ENABLE_DUID
+# include "duid.h"
+#endif
+
+#ifdef ENABLE_INFO
+# include "info.h"
+#endif
+
/* We need this for our maximum timeout as FreeBSD's select cannot handle
any higher than this. Is there a better way of working this out? */
#define SELECT_MAX 100000000
options->metric))) == NULL)
return (-1);
+#ifdef ENABLE_DUID
+ if (options->clientid_len == 0) {
+ get_duid (iface);
+ if (iface->duid_length > 0)
+ logger (LOG_INFO, "DUID = %s",
+ hwaddr_ntoa (iface->duid, iface->duid_length));
+ }
+#endif
+
dhcp = xmalloc (sizeof (dhcp_t));
memset (dhcp, 0, sizeof (dhcp_t));
#include "interface.h"
#include "logger.h"
-#ifdef ENABLE_DUID
-#include "duid.h"
-#endif
-
void free_address (address_t *addresses)
{
address_t *p = addresses;
logger (LOG_INFO, "hardware address = %s",
hwaddr_ntoa (iface->hwaddr, iface->hwlen));
-#ifdef ENABLE_DUID
- get_duid (iface);
- if (iface->duid_length > 0)
- logger (LOG_INFO, "DUID = %s",
- hwaddr_ntoa (iface->duid, iface->duid_length));
-#endif
-
/* 0 is a valid fd, so init to -1 */
iface->fd = -1;