From: Roy Marples Date: Wed, 27 Jun 2007 21:55:44 +0000 (+0000) Subject: Don't do any DUID if we have a user specified ClientID X-Git-Tag: v3.2.3~242 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6390e1ca630550759f167a4207dfd5e0d823c12f;p=thirdparty%2Fdhcpcd.git Don't do any DUID if we have a user specified ClientID --- diff --git a/client.c b/client.c index e1e450f8..b66f2cd9 100644 --- a/client.c +++ b/client.c @@ -49,14 +49,19 @@ #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 @@ -219,6 +224,15 @@ int dhcp_run (const options_t *options, int *pidfd) 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)); diff --git a/interface.c b/interface.c index 556a7189..849b5515 100644 --- a/interface.c +++ b/interface.c @@ -64,10 +64,6 @@ #include "interface.h" #include "logger.h" -#ifdef ENABLE_DUID -#include "duid.h" -#endif - void free_address (address_t *addresses) { address_t *p = addresses; @@ -335,13 +331,6 @@ interface_t *read_interface (const char *ifname, int metric) 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;