diff options
author | obiot <obiot@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-09-26 20:00:37 +0000 |
---|---|---|
committer | obiot <obiot@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-09-26 20:00:37 +0000 |
commit | 023121c6685c05dcf66df4f62a3158ef3252a4fa (patch) | |
tree | 13c8ecf8f41cc70c7c2b3fc45c7ef38c5a245a6c /epan/dissectors/packet-wsp.c | |
parent | 59da1477b01bd28c0134465f98a192dcfbb1294d (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).
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16012 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-wsp.c')
-rw-r--r-- | epan/dissectors/packet-wsp.c | 18 |
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, |