summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkhali <khali>2015-05-04 11:28:49 +0000
committerkhali <khali>2015-05-04 11:28:49 +0000
commit5dc5fa3d1d021cb53795850eac195e6e9449509f (patch)
tree4c3e1b5028a934b22333f3773e38644082fcd692
parentb27744de8a0c39b13a01039ba3812bd48feb5255 (diff)
downloaddmidecode-5dc5fa3d1d021cb53795850eac195e6e9449509f.tar.gz
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.
-rw-r--r--CHANGELOG1
-rw-r--r--dmidecode.c2
2 files changed, 2 insertions, 1 deletions
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 <jdelvare@suse.de>
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);
/*