Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-106774

"ipmitool lan print" returns in error if the BMC doesn't support a given property

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: Generate New Ti...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • rhel-10.0
    • ipmitool
    • Yes
    • Low
    • rhel-base-utils-core
    • 5
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      With DELL systems (at least R740 and R640), executing ipmitool lan print is a success but returns in error because those systems do not support IPMI_LANP_BAD_PASS_THRESH property.
      The error occurs because get_lan_param_select() returns NULL despite the BMC answered with proper code 0x80 "not supported":

       176 /* get_lan_param_select - Query BMC for LAN parameter data
       177  *
       178  * return pointer to lan_param if successful
       179  * if parameter not supported then
       180  *   return pointer to lan_param with
       181  *   lan_param->data == NULL and lan_param->data_len == 0
       182  * return NULL on error
       183  *
       184  * @intf:    ipmi interface handle
       185  * @chan:    ipmi channel
       186  * @param:   lan parameter id
       187  * @select:  lan parameter set selector
       188  */
       189 static struct lan_param *
       190 get_lan_param_select(struct ipmi_intf *intf, uint8_t chan, int param, int select)
       191 {
       :
       222         rsp = intf->sendrecv(intf, &req);
       223         if (!rsp) {
       224                 lprintf(LOG_INFO, "Get LAN Parameter '%s' command failed", p->desc);
       225                 return rc;
       226         }
       227 
       228         switch (rsp->ccode)
       229         {
       230         case 0x00: /* successful */
       231                 break;
       232 
       233         case 0x80: /* parameter not supported */
       234         case 0xc9: /* parameter out of range */
       235         case 0xcc: /* invalid data field in request */
       236                 /* We treat them as valid but empty response */
       237                 p->data = NULL;
       238                 p->data_len = 0;
       239                 rc = p;
       240                 /* fall through */
       241         default:
       242                 /* other completion codes are treated as error */
       243                 lprintf(LOG_INFO, "Get LAN Parameter '%s' command failed: %s",
       244                         p->desc,
       245                         specific_val2str(rsp->ccode,
       246                                          get_lan_cc_vals,
       247                                          completion_code_vals));
       248 >>>             return NULL;
       249         }
        :
      

      The reason is the unexpected return NULL on line 248 instead of return rc, which should apply unconditionally (rc is initialized to NULL so if there is some unknown error this will work anyway):

       233         case 0x80: /* parameter not supported */
       234         case 0xc9: /* parameter out of range */
       235         case 0xcc: /* invalid data field in request */
       236                 /* We treat them as valid but empty response */
       237                 p->data = NULL;
       238                 p->data_len = 0;
       239                 rc = p;
       240                 /* fall through */
       241         default:
       242                 /* other completion codes are treated as error */
       243                 lprintf(LOG_INFO, "Get LAN Parameter '%s' command failed: %s",
       244                         p->desc,
       245                         specific_val2str(rsp->ccode,
       246                                          get_lan_cc_vals,
       247                                          completion_code_vals));
       248 >>>             return rc;
       249         }
      

              rhn-support-pcahyna Pavel Cahyna
              rhn-support-rmetrich Renaud Métrich
              Pavel Cahyna Pavel Cahyna
              RHEL SST CS base utils QE Bot RHEL SST CS base utils QE Bot
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: