]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Don't do any DUID if we have a user specified ClientID
authorRoy Marples <roy@marples.name>
Wed, 27 Jun 2007 21:55:44 +0000 (21:55 +0000)
committerRoy Marples <roy@marples.name>
Wed, 27 Jun 2007 21:55:44 +0000 (21:55 +0000)
client.c
interface.c

index e1e450f8202cf1505ad109bf82a17b5f837cab8c..b66f2cd9df96f7269f39393f085ff19341b531d7 100644 (file)
--- a/client.c
+++ b/client.c
 #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));
 
index 556a718996d01b5535a0a08831bbfbca5a45760e..849b5515c8d9b35d162758390d899438d373b1ae 100644 (file)
 #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;