diff options
author | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2012-12-02 04:49:13 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2012-12-02 04:49:13 +0000 |
commit | 49466f95bc1fe3cc139f3750fcc934ffc210faef (patch) | |
tree | 14c72b7db9d4fe0af875d373d6023c92bae0463a /epan/dissectors/packet-rsvp.c | |
parent | da4442d6384b15530fd740295080a8ad3a145ca6 (diff) |
Introduce, and start using, TVB_SET_ADDRESS() and TVB_SET_ADDRESS_HF(). They
are like the non-TVB versions except that they take a TVB and an offset
instead of (frequently) a pointer into the TVB.
Calling tvb_get_ptr() before modifying the rest of the fields should help fix
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7960 (though I can't
reproduce that problem).
Replace a bunch of calls like:
SET_ADDRESS(..., AT_XXX, length, tvb_get_ptr(tvb, offset, length));
with:
TVB_SET_ADDRESS(..., AT_XXX, tvb, offset, length);
svn path=/trunk/; revision=46324
Diffstat (limited to 'epan/dissectors/packet-rsvp.c')
-rw-r--r-- | epan/dissectors/packet-rsvp.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/epan/dissectors/packet-rsvp.c b/epan/dissectors/packet-rsvp.c index 0e9c6ed604..c40d888477 100644 --- a/epan/dissectors/packet-rsvp.c +++ b/epan/dissectors/packet-rsvp.c @@ -1825,8 +1825,7 @@ dissect_rsvp_session(proto_item *ti, proto_tree *rsvp_object_tree, * later. */ rsvph->session_type = RSVP_SESSION_TYPE_IPV4; - SET_ADDRESS(&rsvph->destination, AT_IPv4, 4, - tvb_get_ptr(tvb, offset2, 4)); + TVB_SET_ADDRESS(&rsvph->destination, AT_IPv4, tvb, offset2, 4); rsvph->protocol = tvb_get_guint8(tvb, offset2+4); rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6); @@ -1881,8 +1880,7 @@ dissect_rsvp_session(proto_item *ti, proto_tree *rsvp_object_tree, * later. */ rsvph->session_type = RSVP_SESSION_TYPE_IPV4_LSP; - SET_ADDRESS(&rsvph->destination, AT_IPv4, 4, - tvb_get_ptr(tvb, offset2, 4)); + TVB_SET_ADDRESS(&rsvph->destination, AT_IPv4, tvb, offset2, 4); rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6); rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8); break; @@ -1904,8 +1902,7 @@ dissect_rsvp_session(proto_item *ti, proto_tree *rsvp_object_tree, * later. */ rsvph->session_type = RSVP_SESSION_TYPE_AGGREGATE_IPV4; - SET_ADDRESS(&rsvph->destination, AT_IPv4, 4, - tvb_get_ptr(tvb, offset2, 4)); + TVB_SET_ADDRESS(&rsvph->destination, AT_IPv4, tvb, offset2, 4); rsvph->dscp = tvb_get_guint8(tvb, offset2+7); rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8); break; @@ -1934,8 +1931,7 @@ dissect_rsvp_session(proto_item *ti, proto_tree *rsvp_object_tree, * later. */ rsvph->session_type = RSVP_SESSION_TYPE_IPV4_UNI; - SET_ADDRESS(&rsvph->destination, AT_IPv4, 4, - tvb_get_ptr(tvb, offset2, 4)); + TVB_SET_ADDRESS(&rsvph->destination, AT_IPv4, tvb, offset2, 4); rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6); rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8); @@ -1965,8 +1961,7 @@ dissect_rsvp_session(proto_item *ti, proto_tree *rsvp_object_tree, * later. */ rsvph->session_type = RSVP_SESSION_TYPE_IPV4_E_NNI; - SET_ADDRESS(&rsvph->destination, AT_IPv4, 4, - tvb_get_ptr(tvb, offset2, 4)); + TVB_SET_ADDRESS(&rsvph->destination, AT_IPv4, tvb, offset2, 4); rsvph->udp_dest_port = tvb_get_ntohs(tvb, offset2+6); rsvph->ext_tunnel_id = tvb_get_ntohl(tvb, offset2 + 8); @@ -2729,7 +2724,7 @@ dissect_rsvp_template_filter(proto_item *ti, proto_tree *rsvp_object_tree, /* * Save this information to build the conversation request key later. */ - SET_ADDRESS(&rsvph->source, AT_IPv4, 4, tvb_get_ptr(tvb, offset2, 4)); + TVB_SET_ADDRESS(&rsvph->source, AT_IPv4, tvb, offset2, 4); rsvph->udp_source_port = tvb_get_ntohs(tvb, offset2+6); break; @@ -2757,7 +2752,7 @@ dissect_rsvp_template_filter(proto_item *ti, proto_tree *rsvp_object_tree, /* * Save this information to build the conversation request key later. */ - SET_ADDRESS(&rsvph->source, AT_IPv4, 4, tvb_get_ptr(tvb, offset2, 4)); + TVB_SET_ADDRESS(&rsvph->source, AT_IPv4, tvb, offset2, 4); rsvph->udp_source_port = tvb_get_ntohs(tvb, offset2+6); break; @@ -2771,7 +2766,7 @@ dissect_rsvp_template_filter(proto_item *ti, proto_tree *rsvp_object_tree, /* * Save this information to build the conversation request key later. */ - SET_ADDRESS(&rsvph->source, AT_IPv4, 4, tvb_get_ptr(tvb, offset2, 4)); + TVB_SET_ADDRESS(&rsvph->source, AT_IPv4, tvb, offset2, 4); break; default: |