diff options
author | Michael Mann <mmann78@netscape.net> | 2017-05-16 22:55:34 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2017-05-17 15:17:20 +0000 |
commit | 8376a8bb26d49145e83479268237c9afe6bdde81 (patch) | |
tree | f172af535cc2f80a3feb351b5facd283f525cf60 /epan/dissectors/packet-stun.c | |
parent | 99b76a5bc3db9579351c0fc7251086660f4f003f (diff) |
Create temporary variables for some proto_tree_add_<datatype> calculations.
checkAPIs.pl doesn't like tvb_get_* parameters because it thinks
proto_tree_add_item should be used. This is just to pacify the check.
Change-Id: If40728bcdf5558c351999057321ffba5d802c7c7
Reviewed-on: https://code.wireshark.org/review/21694
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-stun.c')
-rw-r--r-- | epan/dissectors/packet-stun.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/epan/dissectors/packet-stun.c b/epan/dissectors/packet-stun.c index 8ce2f665cd..06a0cd5114 100644 --- a/epan/dissectors/packet-stun.c +++ b/epan/dissectors/packet-stun.c @@ -547,7 +547,8 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole const char *msg_class_str; const char *msg_method_str; guint16 att_type; - guint16 att_length; + guint16 att_length, clear_port; + guint32 clear_ip; guint i; guint offset; guint magic_cookie_first_word; @@ -1048,8 +1049,8 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole /* Show the port 'in the clear' XOR (host order) transid with (host order) xor-port. Add host-order port into tree. */ - ti = proto_tree_add_uint(att_tree, hf_stun_att_port, tvb, offset+2, 2, - tvb_get_ntohs(tvb, offset+2) ^ (magic_cookie_first_word >> 16)); + clear_port = tvb_get_ntohs(tvb, offset+2) ^ (magic_cookie_first_word >> 16); + ti = proto_tree_add_uint(att_tree, hf_stun_att_port, tvb, offset+2, 2, clear_port); PROTO_ITEM_SET_GENERATED(ti); if (att_length < 8) @@ -1061,8 +1062,8 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole /* Show the address 'in the clear'. XOR (host order) transid with (host order) xor-address. Add in network order tree. */ - ti = proto_tree_add_ipv4(att_tree, hf_stun_att_ipv4, tvb, offset+4, 4, - tvb_get_ipv4(tvb, offset+4) ^ g_htonl(magic_cookie_first_word)); + clear_ip = tvb_get_ipv4(tvb, offset+4) ^ g_htonl(magic_cookie_first_word); + ti = proto_tree_add_ipv4(att_tree, hf_stun_att_ipv4, tvb, offset+4, 4, clear_ip); PROTO_ITEM_SET_GENERATED(ti); { |