diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-08-30 10:14:03 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-08-30 10:14:03 +0000 |
commit | 043548c7fcd2652a7e71f214646ca287b2bc8f60 (patch) | |
tree | 4fc9569f6bce2f3d4fee9093347a601646d7cf88 | |
parent | d2143a880e00dbbf4130133cb61ec948be453616 (diff) | |
download | wireshark-043548c7fcd2652a7e71f214646ca287b2bc8f60.tar.gz wireshark-043548c7fcd2652a7e71f214646ca287b2bc8f60.tar.bz2 wireshark-043548c7fcd2652a7e71f214646ca287b2bc8f60.zip |
From Flavio Poletti: fix a bug in "decode_qos_umts()".
svn path=/trunk/; revision=6143
-rw-r--r-- | packet-gtp.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/packet-gtp.c b/packet-gtp.c index 1c7191d79d..8aa6f7fcd1 100644 --- a/packet-gtp.c +++ b/packet-gtp.c @@ -4,7 +4,7 @@ * Copyright 2001, Michal Melerowicz <michal.melerowicz@nokia.com> * Nicolas Balkota <balkota@mac.com> * - * $Id: packet-gtp.c,v 1.37 2002/08/29 19:05:41 guy Exp $ + * $Id: packet-gtp.c,v 1.38 2002/08/30 10:14:03 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -3394,19 +3394,26 @@ decode_qos_umts(tvbuff_t *tvb, int offset, proto_tree *tree, gchar* qos_str, gui * */ guint8 version_buffer[2]; + /* Will keep the value that will be returned + * */ + int retval = 0; + switch (type) { case 1: length = tvb_get_guint8 (tvb, offset); te = proto_tree_add_text (tree, tvb, offset, length + 1, "%s", qos_str); ext_tree_qos = proto_item_add_subtree (te, ett_gtp_qos); proto_tree_add_text (ext_tree_qos, tvb, offset, 1, "Length: %u", length); + offset++; + retval = length + 1; break; case 2: length = tvb_get_ntohs (tvb, offset + 1); te = proto_tree_add_text(tree, tvb, offset, length + 3, "%s", qos_str); ext_tree_qos = proto_item_add_subtree (te, ett_gtp_qos); proto_tree_add_text (ext_tree_qos, tvb, offset + 1, 2, "Length: %u", length); - type++; /* +1 because of first 0x86 byte for UMTS QoS */ + offset += 3; /* +1 because of first 0x86 byte for UMTS QoS */ + retval = length + 3; break; case 3: /* For QoS inside RADIUS Client messages from GGSN */ @@ -3423,17 +3430,17 @@ decode_qos_umts(tvbuff_t *tvb, int offset, proto_tree *tree, gchar* qos_str, gui /* Now, we modify offset here and in order to use type later * effectively.*/ - offset--; + offset += 2; + retval = length + 3; /* Actually, will be ignored. */ break; default: /* XXX - what should we do with the length here? */ length = 0; + retval = 0; ext_tree_qos = NULL; break; } - offset += type; - /* In RADIUS messages there is no allocation-retention priority * so I don't need to wrap the following call to tvb_get_guint8 * */ @@ -3561,8 +3568,7 @@ decode_qos_umts(tvbuff_t *tvb, int offset, proto_tree *tree, gchar* qos_str, gui } - return length + type; - + return retval; } static void |