Print this page
4586 dhcpv6 client id malformed

@@ -22,12 +22,10 @@
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident   "%Z%%M% %I%     %E% SMI"
-
 /*
  * This module reads and writes the stable identifier values, DUID and IAID.
  */
 
 #include <stdio.h>

@@ -42,10 +40,11 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <net/if.h>
 #include <netinet/dhcp6.h>
 #include <dhcp_inittab.h>
+#include <sys/ethernet.h>
 
 #define DUID_FILE       "/etc/dhcp/duid"
 #define IAID_FILE       "/etc/dhcp/iaid"
 
 struct iaid_ent {

@@ -141,10 +140,11 @@
          * Try to read the MAC layer address for the physical interface
          * provided as a hint.  If that works, we can use a DUID-LLT.
          */
 
         if (dlpi_open(physintf, &dh, 0) == DLPI_SUCCESS &&
+            dlpi_bind(dh, ETHERTYPE_IPV6, NULL) == DLPI_SUCCESS &&
             dlpi_info(dh, &dlinfo, 0) == DLPI_SUCCESS &&
             (len = dlinfo.di_physaddrlen) > 0 &&
             (arptype = dlpi_arptype(dlinfo.di_mactype) != 0)) {
                 duid_llt_t *dllt;
                 time_t now;