From 5dc5fa3d1d021cb53795850eac195e6e9449509f Mon Sep 17 00:00:00 2001 From: khali Date: Mon, 4 May 2015 11:28:49 +0000 Subject: dmidecode: Display types 41 and 42 in quiet mode too Originally the highest regular DMI structure type was 39, and non-OEM types greater than that (including 126/disabled and 127/end-of-table) wouldn't show up in quiet mode. The limit was not updated when types 41 and 42 were added to the SMBIOS specification, so these types do not show up in quiet mode. Fix that. We could simply raise the limit from 39 to 42, but the fact that this bug went unnoticed for years is probably a good indication that this limit was a bad idea in the first place and it is safer to only explicitly hide types 126 and 127 in quiet mode. --- CHANGELOG | 1 + dmidecode.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index cb7b202..3d75326 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ * dmidecode.c: Move table decoding to a separate function. * dmidecode.c: Simplify function dmi_table_dump. + * dmidecode.c: Display types 41 and 42 in quiet mode too. 2015-04-28 Jean Delvare diff --git a/dmidecode.c b/dmidecode.c index 05858b4..94f0711 100644 --- a/dmidecode.c +++ b/dmidecode.c @@ -4379,7 +4379,7 @@ static void dmi_table_decode(u8 *buf, u32 len, u16 num, u16 ver, u32 flags) to_dmi_header(&h, data); display = ((opt.type == NULL || opt.type[h.type]) - && !((opt.flags & FLAG_QUIET) && (h.type > 39 && h.type <= 127)) + && !((opt.flags & FLAG_QUIET) && (h.type == 126 || h.type == 127)) && !opt.string); /* -- cgit v1.2.1