Print this page
4586 dhcpv6 client id malformed

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libdhcpagent/common/dhcp_stable.c
          +++ new/usr/src/lib/libdhcpagent/common/dhcp_stable.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  28      -
  29   27  /*
  30   28   * This module reads and writes the stable identifier values, DUID and IAID.
  31   29   */
  32   30  
  33   31  #include <stdio.h>
  34   32  #include <stdlib.h>
  35   33  #include <unistd.h>
  36   34  #include <string.h>
  37   35  #include <limits.h>
  38   36  #include <fcntl.h>
  39   37  #include <errno.h>
  40   38  #include <libdlpi.h>
  41   39  #include <uuid/uuid.h>
  42   40  #include <sys/types.h>
  43   41  #include <sys/stat.h>
  44   42  #include <net/if.h>
  45   43  #include <netinet/dhcp6.h>
  46   44  #include <dhcp_inittab.h>
       45 +#include <sys/ethernet.h>
  47   46  
  48   47  #define DUID_FILE       "/etc/dhcp/duid"
  49   48  #define IAID_FILE       "/etc/dhcp/iaid"
  50   49  
  51   50  struct iaid_ent {
  52   51          uint32_t        ie_iaid;
  53   52          char            ie_name[LIFNAMSIZ];
  54   53  };
  55   54  
  56   55  /*
↓ open down ↓ 79 lines elided ↑ open up ↑
 136  135          dlpi_handle_t dh = NULL;
 137  136          uint_t arptype;
 138  137          duid_en_t *den;
 139  138  
 140  139          /*
 141  140           * Try to read the MAC layer address for the physical interface
 142  141           * provided as a hint.  If that works, we can use a DUID-LLT.
 143  142           */
 144  143  
 145  144          if (dlpi_open(physintf, &dh, 0) == DLPI_SUCCESS &&
      145 +            dlpi_bind(dh, ETHERTYPE_IPV6, NULL) == DLPI_SUCCESS &&
 146  146              dlpi_info(dh, &dlinfo, 0) == DLPI_SUCCESS &&
 147  147              (len = dlinfo.di_physaddrlen) > 0 &&
 148  148              (arptype = dlpi_arptype(dlinfo.di_mactype) != 0)) {
 149  149                  duid_llt_t *dllt;
 150  150                  time_t now;
 151  151  
 152  152                  if ((dllt = malloc(sizeof (*dllt) + len)) == NULL) {
 153  153                          dlpi_close(dh);
 154  154                          return (NULL);
 155  155                  }
↓ open down ↓ 148 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX