diff options
author | Michael Mann <mmann78@netscape.net> | 2015-02-26 22:03:12 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-03-01 12:54:33 +0000 |
commit | 9c55903029ee0e6720597ef07e8a5b359cae068e (patch) | |
tree | 251dddfa5de23777e225e128529b00a7a0143b76 /epan/dissectors/packet-sna.c | |
parent | 5f2c8e9575eb6afb6c645d43a015cff035fcbeb0 (diff) |
Use COPY_ADDRESS_SHALLOW instead of duplicating TVB_SET_ADDRESS and SET_ADDRESS calls for the same address.
Change-Id: I0c9cc5d574fdd73ecf1f8b32dbbf0ddb2b885116
Reviewed-on: https://code.wireshark.org/review/7437
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-sna.c')
-rw-r--r-- | epan/dissectors/packet-sna.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-sna.c b/epan/dissectors/packet-sna.c index d66ca3f552..effac96aff 100644 --- a/epan/dissectors/packet-sna.c +++ b/epan/dissectors/packet-sna.c @@ -1729,13 +1729,13 @@ dissect_fid0_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Set DST addr */ TVB_SET_ADDRESS(&pinfo->net_dst, sna_address_type, tvb, 2, SNA_FID01_ADDR_LEN); - TVB_SET_ADDRESS(&pinfo->dst, sna_address_type, tvb, 2, SNA_FID01_ADDR_LEN); + COPY_ADDRESS_SHALLOW(&pinfo->dst, &pinfo->net_dst); proto_tree_add_item(tree, hf_sna_th_oaf, tvb, 4, 2, ENC_BIG_ENDIAN); /* Set SRC addr */ TVB_SET_ADDRESS(&pinfo->net_src, sna_address_type, tvb, 4, SNA_FID01_ADDR_LEN); - TVB_SET_ADDRESS(&pinfo->src, sna_address_type, tvb, 4, SNA_FID01_ADDR_LEN); + COPY_ADDRESS_SHALLOW(&pinfo->src, &pinfo->net_src); proto_tree_add_item(tree, hf_sna_th_snf, tvb, 6, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sna_th_dcf, tvb, 8, 2, ENC_BIG_ENDIAN); @@ -1781,14 +1781,14 @@ dissect_fid2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* Set DST addr */ TVB_SET_ADDRESS(&pinfo->net_dst, sna_address_type, tvb, 2, SNA_FID2_ADDR_LEN); - TVB_SET_ADDRESS(&pinfo->dst, sna_address_type, tvb, 2, SNA_FID2_ADDR_LEN); + COPY_ADDRESS_SHALLOW(&pinfo->dst, &pinfo->net_dst); /* Byte 3 */ proto_tree_add_item(tree, hf_sna_th_oaf, tvb, 3, 1, ENC_BIG_ENDIAN); /* Set SRC addr */ TVB_SET_ADDRESS(&pinfo->net_src, sna_address_type, tvb, 3, SNA_FID2_ADDR_LEN); - TVB_SET_ADDRESS(&pinfo->src, sna_address_type, tvb, 3, SNA_FID2_ADDR_LEN); + COPY_ADDRESS_SHALLOW(&pinfo->src, &pinfo->net_src); id = tvb_get_ntohs(tvb, 4); proto_tree_add_item(tree, hf_sna_th_snf, tvb, 4, 2, ENC_BIG_ENDIAN); @@ -1979,7 +1979,7 @@ dissect_fid4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) dst->saf = dsaf; dst->ef = def; SET_ADDRESS(&pinfo->net_dst, sna_address_type, SNA_FID_TYPE_4_ADDR_LEN, dst); - SET_ADDRESS(&pinfo->dst, sna_address_type, SNA_FID_TYPE_4_ADDR_LEN, dst); + COPY_ADDRESS_SHALLOW(&pinfo->dst, &pinfo->net_dst); oef = tvb_get_ntohs(tvb, 20); proto_tree_add_uint(tree, hf_sna_th_oef, tvb, offset+2, 2, oef); @@ -1989,7 +1989,7 @@ dissect_fid4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) src->saf = osaf; src->ef = oef; SET_ADDRESS(&pinfo->net_src, sna_address_type, SNA_FID_TYPE_4_ADDR_LEN, src); - SET_ADDRESS(&pinfo->src, sna_address_type, SNA_FID_TYPE_4_ADDR_LEN, src); + COPY_ADDRESS_SHALLOW(&pinfo->src, &pinfo->net_src); proto_tree_add_item(tree, hf_sna_th_snf, tvb, offset+4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_sna_th_dcf, tvb, offset+6, 2, ENC_BIG_ENDIAN); |