Print this page
NEX-9891 Unable to use ipmitopo to return IPMI data for ipmi-enabled JBODs
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libipmi/common/ipmi_lan.c
          +++ new/usr/src/lib/libipmi/common/ipmi_lan.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + * Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
  24   25   */
  25   26  
  26   27  #include <stdlib.h>
  27   28  #include <stdio.h>
  28   29  #include <assert.h>
  29   30  #include <inttypes.h>
  30   31  #include <string.h>
  31   32  #include <sys/types.h>
  32   33  #include <sys/socket.h>
  33   34  #include <netinet/in.h>
↓ open down ↓ 437 lines elided ↑ open up ↑
 471  472  
 472  473          /* message length */
 473  474          msg[off++] = req->ic_dlen + 7;
 474  475          cs = off;
 475  476  
 476  477          /* IPMI message header */
 477  478          (void) memset(&msg_hdr, 0, sizeof (msg_hdr));
 478  479          msg_hdr.imh_addr1 = IPMI_BMC_SLAVE_ADDR;
 479  480          msg_hdr.imh_lun = req->ic_lun;
 480  481          msg_hdr.imh_netfn = req->ic_netfn;
 481      -        tmp = off - cs;
 482      -        msg_hdr.imh_csum = ipmi_csum(msg + cs, tmp);
      482 +        msg_hdr.imh_csum = ipmi_csum((uint8_t *)&msg_hdr, sizeof (msg_hdr));
 483  483          cs = off;
 484  484          msg_hdr.imh_addr2 = IPMI_BMC_SLAVE_ADDR;
 485  485          entry->ire_rq_seq = curr_seq++;
 486  486          msg_hdr.imh_seq = entry->ire_rq_seq << 2;
 487  487          msg_hdr.imh_cmd = req->ic_cmd;
 488  488          (void) memcpy(msg + off, &msg_hdr, sizeof (msg_hdr));
 489  489          off += sizeof (msg_hdr);
 490  490  
 491  491          /* message data */
 492  492          if (req->ic_dlen != 0) {
↓ open down ↓ 418 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX