aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Quantin <pascal@wireshark.org>2019-09-03 17:57:47 +0200
committerPascal Quantin <pascal@wireshark.org>2019-09-03 16:35:37 +0000
commit993733dda8e535d5bcdad5baae284b6caad78fd5 (patch)
tree2340430fc06c36070c03dcaa0fe835f084b41724
parentdebdd826785fa16bbcc463602ba4931fcf4ffaef (diff)
NAS 5GS: fix dissection of Session-AMBR/GFBR/MFBR unit
Change-Id: Iccbc89a586abd33db0dd8c16974ad8d9b5bd21f9 Reviewed-on: https://code.wireshark.org/review/34443 Petri-Dish: Pascal Quantin <pascal@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal@wireshark.org>
-rw-r--r--epan/dissectors/packet-nas_5gs.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/epan/dissectors/packet-nas_5gs.c b/epan/dissectors/packet-nas_5gs.c
index 9a4bb1224b..cf289f1244 100644
--- a/epan/dissectors/packet-nas_5gs.c
+++ b/epan/dissectors/packet-nas_5gs.c
@@ -462,22 +462,21 @@ get_ext_ambr_unit(guint32 unit, const char **unit_str)
*unit_str = "Unit value 0, Illegal";
return mult;
}
- unit = unit - 1;
if (unit <= 0x05) {
- mult = pow4(guint32, unit);
+ mult = pow4(guint32, unit - 0x01);
*unit_str = "Kbps";
} else if (unit <= 0x0a) {
- mult = pow4(guint32, unit - 0x05);
+ mult = pow4(guint32, unit - 0x06);
*unit_str = "Mbps";
- } else if (unit <= 0x0e) {
- mult = pow4(guint32, unit - 0x07);
+ } else if (unit <= 0x0f) {
+ mult = pow4(guint32, unit - 0x0b);
*unit_str = "Gbps";
} else if (unit <= 0x14) {
- mult = pow4(guint32, unit - 0x0c);
+ mult = pow4(guint32, unit - 0x10);
*unit_str = "Tbps";
} else if (unit <= 0x19) {
- mult = pow4(guint32, unit - 0x11);
+ mult = pow4(guint32, unit - 0x15);
*unit_str = "Pbps";
} else {
mult = 256;