aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-wsp.c
diff options
context:
space:
mode:
authorOlivier Biot <obiot.ethereal@gmail.com>2005-09-26 20:00:37 +0000
committerOlivier Biot <obiot.ethereal@gmail.com>2005-09-26 20:00:37 +0000
commit875fb98655c021fa1759afedb97d7f7708e792b2 (patch)
tree13c8ecf8f41cc70c7c2b3fc45c7ef38c5a245a6c /epan/dissectors/packet-wsp.c
parentd415c719aece5a2aecc5fbf042f32b7b0f164eee (diff)
Fix WSP redirect and SIR address parsing:
- The incorrect number of octets were highlighted (bearer type and port number were disregarded). - In SIR version 1 content, correct the parsing (full WSP address length was not added to the offset for parsing the non-WSP contact points). svn path=/trunk/; revision=16012
Diffstat (limited to 'epan/dissectors/packet-wsp.c')
-rw-r--r--epan/dissectors/packet-wsp.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/epan/dissectors/packet-wsp.c b/epan/dissectors/packet-wsp.c
index 6cd52b9a1d..e98d23c2c7 100644
--- a/epan/dissectors/packet-wsp.c
+++ b/epan/dissectors/packet-wsp.c
@@ -4492,6 +4492,7 @@ dissect_redirect(tvbuff_t *tvb, int offset, packet_info *pinfo,
address redir_address;
conversation_t *conv;
guint32 index = 0; /* Address index */
+ guint32 address_record_len; /* Length of the entire address record */
/*
* Redirect flags.
@@ -4524,10 +4525,14 @@ dissect_redirect(tvbuff_t *tvb, int offset, packet_info *pinfo,
*/
address_flags_len = tvb_get_guint8 (tvb, offset);
address_len = address_flags_len & ADDRESS_LEN;
- if (tree) {
+ address_record_len = address_len
+ + (address_flags_len & BEARER_TYPE_INCLUDED ? 1 : 0)
+ + (address_flags_len & PORT_NUMBER_INCLUDED ? 2 : 0)
+ ;
+ if (tree) {
ti = proto_tree_add_uint(addresses_tree, hf_address_entry,
- tvb, offset, 1 + address_len, index);
+ tvb, offset, 1 + address_record_len, index);
addr_tree = proto_item_add_subtree(ti, ett_address);
ti = proto_tree_add_uint (addr_tree, hf_address_flags_length,
@@ -4700,6 +4705,7 @@ add_addresses(proto_tree *tree, tvbuff_t *tvb, int hf)
guint32 tvb_len = tvb_length(tvb);
guint32 offset = 0;
guint32 index = 0; /* Address index */
+ guint32 address_record_len; /* Length of the entire address record */
/* Skip needless processing */
if (! tree)
@@ -4720,9 +4726,13 @@ add_addresses(proto_tree *tree, tvbuff_t *tvb, int hf)
*/
address_flags_len = tvb_get_guint8 (tvb, offset);
address_len = address_flags_len & ADDRESS_LEN;
+ address_record_len = address_len
+ + (address_flags_len & BEARER_TYPE_INCLUDED ? 1 : 0)
+ + (address_flags_len & PORT_NUMBER_INCLUDED ? 2 : 0)
+ ;
ti = proto_tree_add_uint(addresses_tree, hf_address_entry,
- tvb, offset, 1 + address_len, index);
+ tvb, offset, 1 + address_record_len, index);
addr_tree = proto_item_add_subtree(ti, ett_address);
ti = proto_tree_add_uint (addr_tree, hf_address_flags_length,
@@ -4896,6 +4906,8 @@ dissect_sir(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (version == 0)
return;
+ offset += val_len;
+
/* Length of non-WSP contact points list */
val_len = tvb_get_guintvar(tvb, offset, &len);
proto_tree_add_uint(subtree, hf_sir_contact_points_len,