bugGNU FreeIPMI - Bugs: bug #38799, IPMI 2.0 "Special Timestamp...

 
 

bug #38799: IPMI 2.0 "Special Timestamp values" are not supported

Submitter:  Rob Swindell <rswindell>
Submitted:  Mon 22 Apr 2013 04:38:24 AM UTC
   
 
Category:  ipmi-sel Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Improper Behaviour
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 01 May 2013 01:04:38 AM UTC, comment #3: 

This has been fixed in the FreeIPMI trunk.

A new function ipmi_timestamp_string() was added into libfreeipmi and was used appropriately throughout FreeIPMI (in ipmi-fru, ipmi-sel, ipmi-sensors, ipmi-oem, ipmi-dcmi, and bmc-device).


Albert Chu <chu11>
Group administrator
Sat 27 Apr 2013 03:39:48 PM UTC, comment #2: 

In order to get this to work in all of FreeIPMI, it'll require a bit of architecture change, so I'm going to aim this for FreeIPMI 1.3.1 instead of a 1.2.X minor release.

Albert Chu <chu11>
Group administrator
Thu 25 Apr 2013 10:29:12 PM UTC, comment #1: 

Here's a patch for one instance of this problem. A more generic "IPMI timestamp" display function should be created and used through-out the IPMI/DCMI code to address this problem globally:

Index: bmc-device/bmc-device.c
===================================================================
--- bmc-device/bmc-device.c     (revision 9608)
+++ bmc-device/bmc-device.c     (working copy)
@@ -1274,15 +1274,26 @@
       goto cleanup;
     }

-  /* Posix says individual calls need not clear/set all portions of
-   * 'struct tm', thus passing 'struct tm' between functions could
-   * have issues.  So we need to memset.
-   */
-  memset (&tm, '\0', sizeof(struct tm));
+/* Per IPMI 2.0 section 37.1: */
+#define IPMI_TIMESTAMP_UNSPECIFIED      0xffffffff
+#define IPMI_TIMESTAMP_POST_INIT        0x20000000
+  if (val == IPMI_TIMESTAMP_UNSPECIFIED)
+    snprintf (timestr, sizeof (timestr), "Unspecified");
+  else if (val <= IPMI_TIMESTAMP_POST_INIT)
+    snprintf (timestr, sizeof (timestr), "%u seconds since initialization", (unsigned)val);
+  else
+    {
+      /* Posix says individual calls need not clear/set all portions of
+       * 'struct tm', thus passing 'struct tm' between functions could
+       * have issues.  So we need to memset.
+       */
+      memset (&tm, '\0', sizeof(struct tm));

-  t = val;
-  localtime_r (&t, &tm);
-  strftime (timestr, sizeof (timestr), "%m/%d/%Y - %H:%M:%S", &tm);
+      t = val;
+      localtime_r (&t, &tm);
+      strftime (timestr, sizeof (timestr), "%m/%d/%Y - %H:%M:%S", &tm);
+    }
+
   pstdout_printf (state_data->pstate,
                   "SEL Time : %s\n",
                   timestr);

Rob Swindell <rswindell>
Mon 22 Apr 2013 04:38:24 AM UTC, original submission:  

IPMI 2.0 section 37.1 ("Special Timestamp values") states that the timestamp values 0xffffffff and values 0x00000000 through 0x20000000 are to be treat specially, yet ipmi-sel and bmc-device do not treat these timestamp values (e.g. from SEL or SDR repository) any different than any other timestamp values.

To be compliant with IPMI 2.0 section 37.1:

Timestamp value 0xffffffff should be displayed to the user as "unknown" or "unspecified".

Timestamp values 0x00000000 through 0x20000000 should be displayed as "seconds since initialization" and not interpreted/displayed as an actual wall-clock date/time.

Rob Swindell <rswindell>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by chu11 (Posted a comment)
  • -email is unavailable- added by rswindell (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-05-01 chu11 Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code