Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
librtas.156
librtas.fix_LE_parsing_of_SRC-FRU_events.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File librtas.fix_LE_parsing_of_SRC-FRU_events.patch of Package librtas.156
commit 52263814c46210b51e564748050299620726dfd1 Author: Nathan Fontenot <nfont@linux.vnet.ibm.com> Date: Fri Oct 17 10:12:54 2014 -0400 Fix LE parsing of SRC/FRU events Signed-off-by: Thomas L Falcon <tlfalcon@linux.vnet.ibm.com> Signed-off-by: Suzuki K. Poulose <suzuki@in.ibm.com> diff --git a/librtasevent_src/get_rtas_event.c b/librtasevent_src/get_rtas_event.c index efd412f..3a5e034 100644 --- a/librtasevent_src/get_rtas_event.c +++ b/librtasevent_src/get_rtas_event.c @@ -336,12 +336,7 @@ parse_v6_rtas_event(struct rtas_event *re) case RTAS_PSRC_SCN: case RTAS_SSRC_SCN: -#if __BYTE_ORDER == __LITTLE_ENDIAN - fprintf(stderr, "Parsing RTAS SRC Sections on little endian not supported\n"); - rc = -1; -#else rc = parse_src_scn(re); -#endif break; case RTAS_HP_SCN: diff --git a/librtasevent_src/rtas_srcfru.c b/librtasevent_src/rtas_srcfru.c index 1fb1840..6ce9e76 100644 --- a/librtasevent_src/rtas_srcfru.c +++ b/librtasevent_src/rtas_srcfru.c @@ -56,7 +56,7 @@ parse_fru_id_scn(struct rtas_event *re) memset(fru_id, 0, sizeof(*fru_id)); - fru_id_raw = (struct rtas_fru_id_scn_raw *)re->buffer + re->offset; + fru_id_raw = (struct rtas_fru_id_scn_raw *)(re->buffer + re->offset); parse_fru_hdr(&fru_id->fruhdr, &fru_id_raw->fruhdr); re->offset += RE_FRU_HDR_SZ; @@ -105,7 +105,7 @@ parse_fru_pe_scn(struct rtas_event *re) } memset(fru_pe, 0, sizeof(*fru_pe)); - fru_pe_raw = (struct rtas_fru_pe_scn_raw *)re->buffer + re->offset; + fru_pe_raw = (struct rtas_fru_pe_scn_raw *)(re->buffer + re->offset); parse_fru_hdr(&fru_pe->fruhdr, &fru_pe_raw->fruhdr); re->offset += RE_FRU_HDR_SZ; @@ -138,7 +138,7 @@ parse_fru_mr_scn(struct rtas_event *re) } memset(fru_mr, 0, sizeof(*fru_mr)); - fru_mr_raw = (struct rtas_fru_mr_scn_raw *)re->buffer + re->offset; + fru_mr_raw = (struct rtas_fru_mr_scn_raw *)(re->buffer + re->offset); parse_fru_hdr(&fru_mr->fruhdr, &fru_mr_raw->fruhdr); re->offset += RE_FRU_HDR_SZ; @@ -186,17 +186,23 @@ parse_src_scn(struct rtas_event *re) struct rtas_src_scn_raw *src_raw; struct rtas_fru_scn *fru, *last_fru; int total_len, srcsub_len; - src = malloc(sizeof(*src)); if (src == NULL) { errno = ENOMEM; return 1; } + + src_raw = malloc(sizeof(*src_raw)); + if (src_raw == NULL) { + errno = ENOMEM; + return 1; + } memset(src, 0, sizeof(*src)); + memset(src_raw, 0, sizeof(*src_raw)); src->shdr.raw_offset = re->offset; - src_raw = (struct rtas_src_scn_raw *)(re->buffer + re->offset); + rtas_copy(src_raw, re, RE_SRC_SCN_SZ); parse_v6_hdr(&src->v6hdr, &src_raw->v6hdr); src->version = src_raw->version; @@ -216,16 +222,16 @@ parse_src_scn(struct rtas_event *re) memcpy(&src->primary_refcode, &src_raw->primary_refcode, sizeof(src->primary_refcode)); - re->offset += RE_SRC_SCN_SZ; add_re_scn(re, src, re_scn_id(&src_raw->v6hdr)); if (!src_subscns_included(src)) return 0; + rtas_copy( (char *) src_raw + RE_SRC_SCN_SZ + 4, re, RE_SRC_SUBSCN_SZ); + src->subscn_id = src_raw->subscn_id; src->subscn_platform_data = src_raw->subscn_platform_data; src->subscn_length = be16toh(src_raw->subscn_length); - re->offset += RE_SRC_SUBSCN_SZ; srcsub_len = src->subscn_length * 4; /*get number of bytes */ total_len = RE_SRC_SUBSCN_SZ; @@ -236,7 +242,6 @@ parse_src_scn(struct rtas_event *re) uint32_t fru_len, fru_end; struct rtas_fru_hdr *last_fruhdr = NULL; struct rtas_fru_scn_raw *rawfru; - fru = malloc(sizeof(*fru)); if (fru == NULL) { cleanup_rtas_event(re); @@ -245,7 +250,7 @@ parse_src_scn(struct rtas_event *re) } memset(fru, 0, sizeof(*fru)); - + rawfru = (struct rtas_fru_scn_raw *)(re->buffer + re->offset); parse_fru_scn(re, fru, rawfru);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor