From ac1b3e1d4697e7ffe05a23c20e5575d45de12eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Spruck?= Date: Sun, 13 Dec 2015 21:41:14 +0100 Subject: [PATCH] ID:404 - Edit FRU information update problem Targets as a problem with editing FRUs (like ipmitool .... fru edit 0 field b 0 "blahblah") where the header (multirecord area offset) is not correctly updated. It is supposed to modify the header offset to muti-record area if any of the three previous areas has been edited. Remark: this has to occur before the new header crc is calculated. Thats the reson the modification is not close to the actual movement of the data. Maybe it would be nicer to change the order in the code here. But I do not want to add undesired behaviour, thus keeping a clear and small patch. --- lib/ipmi_fru.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ipmi_fru.c b/lib/ipmi_fru.c index 40f98e7..5ca6466 100644 --- a/lib/ipmi_fru.c +++ b/lib/ipmi_fru.c @@ -5042,6 +5042,11 @@ ipmi_fru_set_field_string_rebuild(struct ipmi_intf * intf, uint8_t fruId, header.offset.product += change_size_by_8; } + if ((f_type == 'c' ) || (f_type == 'b' ) || (f_type == 'p' )) { + printf("Change multi offset from %d to %d\n", header.offset.multi, header.offset.multi + change_size_by_8); + header.offset.multi += change_size_by_8; + } + /* Adjust length of the section */ if (f_type == 'c') {