From 993733dda8e535d5bcdad5baae284b6caad78fd5 Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Tue, 3 Sep 2019 17:57:47 +0200 Subject: 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 Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin --- epan/dissectors/packet-nas_5gs.c | 13 ++++++------- 1 file 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; -- cgit v1.2.3