From a2c2f872f4eb2ba393d091a5623b1168689e6b09 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Sat, 22 Nov 2014 16:15:17 -0500 Subject: Remove the use of pinfo->private_data from dissectors that just save it to restore it. Change-Id: I13197cc48068bb35ee12a7023cfe5f76bbc4e264 Reviewed-on: https://code.wireshark.org/review/5486 Petri-Dish: Michael Mann Reviewed-by: Michael Mann --- epan/dissectors/packet-bgp.c | 7 ------- epan/dissectors/packet-cisco-wids.c | 7 ------- epan/dissectors/packet-ethertype.c | 7 ------- epan/dissectors/packet-gsm_a_dtap.c | 4 ---- epan/dissectors/packet-gssapi.c | 7 ------- epan/dissectors/packet-h223.c | 7 ------- epan/dissectors/packet-ieee8023.c | 8 +------- epan/dissectors/packet-infiniband.c | 8 +------- epan/dissectors/packet-isl.c | 8 +------- epan/dissectors/packet-ldp.c | 8 -------- epan/dissectors/packet-nbns.c | 7 ------- epan/dissectors/packet-ntlmssp.c | 31 +++---------------------------- epan/dissectors/packet-rpc.c | 8 -------- epan/dissectors/packet-sctp.c | 7 ------- epan/dissectors/packet-sflow.c | 7 ------- epan/dissectors/packet-tcp.c | 3 --- epan/dissectors/packet-tcp.h | 3 +-- epan/dissectors/packet-tds.c | 7 ------- epan/dissectors/packet-tpkt.c | 15 --------------- epan/dissectors/packet-websocket.c | 3 --- 20 files changed, 7 insertions(+), 155 deletions(-) (limited to 'epan/dissectors') diff --git a/epan/dissectors/packet-bgp.c b/epan/dissectors/packet-bgp.c index 5e2fc78010..93e0b8c24e 100644 --- a/epan/dissectors/packet-bgp.c +++ b/epan/dissectors/packet-bgp.c @@ -6640,7 +6640,6 @@ dissect_bgp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint length; volatile gboolean first = TRUE; /* TRUE for the first BGP message in packet */ tvbuff_t *volatile next_tvb; - void *pd_save; col_set_str(pinfo->cinfo, COL_PROTOCOL, "BGP"); col_clear(pinfo->cinfo, COL_INFO); @@ -6789,16 +6788,10 @@ dissect_bgp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * stop dissecting PDUs within this frame or chunk of reassembled * data. */ - pd_save = pinfo->private_data; TRY { dissect_bgp_pdu(next_tvb, pinfo, tree, first); } CATCH_NONFATAL_ERRORS { - /* Restore the private_data structure in case one of the - * called dissectors modified it (and, due to the exception, - * was unable to restore it). - */ - pinfo->private_data = pd_save; show_exception(tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; diff --git a/epan/dissectors/packet-cisco-wids.c b/epan/dissectors/packet-cisco-wids.c index 93a07f6eb8..854a414be7 100644 --- a/epan/dissectors/packet-cisco-wids.c +++ b/epan/dissectors/packet-cisco-wids.c @@ -77,7 +77,6 @@ dissect_cwids(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree *ti, *cwids_tree; volatile int offset = 0; guint16 capturelen; - void *pd_save; col_set_str(pinfo->cinfo, COL_PROTOCOL, "CWIDS"); col_set_str(pinfo->cinfo, COL_INFO, "Cwids: "); @@ -107,17 +106,11 @@ dissect_cwids(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) wlan_tvb = tvb_new_subset_length(tvb, offset, capturelen); /* Continue after ieee80211 dissection errors */ - pd_save = pinfo->private_data; TRY { call_dissector(ieee80211_handle, wlan_tvb, pinfo, tree); } CATCH_BOUNDS_ERRORS { show_exception(wlan_tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); - /* Restore the private_data structure in case one of the - * called dissectors modified it (and, due to the exception, - * was unable to restore it). - */ - pinfo->private_data = pd_save; expert_add_info(pinfo, ti, &ie_ieee80211_subpacket); } ENDTRY; diff --git a/epan/dissectors/packet-ethertype.c b/epan/dissectors/packet-ethertype.c index 5bb19cc779..d2b8c1f177 100644 --- a/epan/dissectors/packet-ethertype.c +++ b/epan/dissectors/packet-ethertype.c @@ -253,7 +253,6 @@ dissect_ethertype(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat gint captured_length, reported_length; volatile gboolean dissector_found = FALSE; const char *volatile saved_proto; - void *pd_save; ethertype_data_t *ethertype_data; /* Reject the packet if data is NULL */ @@ -298,7 +297,6 @@ dissect_ethertype(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat was reduced by some dissector before an exception was thrown, we can still put in an item for the trailer. */ saved_proto = pinfo->current_proto; - pd_save = pinfo->private_data; TRY { dissector_found = dissector_try_uint(ethertype_dissector_table, ethertype_data->etype, next_tvb, pinfo, tree); @@ -316,11 +314,6 @@ dissect_ethertype(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat before we called the subdissector. */ show_exception(next_tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); - /* Restore the private_data structure in case one of the - * called dissectors modified it (and, due to the exception, - * was unable to restore it). - */ - pinfo->private_data = pd_save; dissector_found = TRUE; pinfo->current_proto = saved_proto; } diff --git a/epan/dissectors/packet-gsm_a_dtap.c b/epan/dissectors/packet-gsm_a_dtap.c index 91861a4a0f..f028267fcc 100644 --- a/epan/dissectors/packet-gsm_a_dtap.c +++ b/epan/dissectors/packet-gsm_a_dtap.c @@ -2565,14 +2565,11 @@ de_facility(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, guint32 header_len; asn1_ctx_t asn1_ctx; tvbuff_t *SS_tvb = NULL; - void *save_private_data; static gint comp_type_tag; asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo); - save_private_data= pinfo->private_data; saved_offset = offset; - pinfo->private_data = NULL; col_append_str(pinfo->cinfo, COL_PROTOCOL,"/"); col_set_fence(pinfo->cinfo, COL_PROTOCOL); while (fac_len > (offset - saved_offset)) { @@ -2593,7 +2590,6 @@ de_facility(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, call_dissector(gsm_map_handle, SS_tvb, pinfo, tree); offset = offset + component_len; } - pinfo->private_data = save_private_data; return (fac_len); } /* diff --git a/epan/dissectors/packet-gssapi.c b/epan/dissectors/packet-gssapi.c index 29a342b6eb..2434b5a113 100644 --- a/epan/dissectors/packet-gssapi.c +++ b/epan/dissectors/packet-gssapi.c @@ -198,7 +198,6 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gssapi_frag_info_t *fi; tvbuff_t *volatile gss_tvb=NULL; asn1_ctx_t asn1_ctx; - void *pd_save; start_offset=0; offset=0; @@ -243,7 +242,6 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * in the packet after our blob to see, so we just re-throw the * exception. */ - pd_save = pinfo->private_data; TRY { gss_tvb=tvb; @@ -515,12 +513,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * the trailer, after noting that a dissector was found * and restoring the protocol value that was in effect * before we called the subdissector. - * - * Restore the private_data structure in case one of the - * called dissectors modified it (and, due to the exception, - * was unable to restore it). */ - pinfo->private_data = pd_save; show_exception(gss_tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; diff --git a/epan/dissectors/packet-h223.c b/epan/dissectors/packet-h223.c index 581ea1a94f..723711ce93 100644 --- a/epan/dissectors/packet-h223.c +++ b/epan/dissectors/packet-h223.c @@ -1205,7 +1205,6 @@ dissect_mux_pdu_fragment( tvbuff_t *tvb, guint32 start_offset, gboolean header_parsed = FALSE; guint32 header_buf = 0, tail_buf = 0; guint32 pdu_minlen = 0; - void *pd_save; #ifdef DEBUG_H223_FRAGMENTATION @@ -1272,16 +1271,10 @@ dissect_mux_pdu_fragment( tvbuff_t *tvb, guint32 start_offset, * stop dissecting PDUs within this frame or chunk of reassembled * data. */ - pd_save = pinfo->private_data; TRY { dissect_mux_pdu( next_tvb, pinfo, start_offset, h223_tree, call_info, ctype, circuit_id); } CATCH_NONFATAL_ERRORS { - /* Restore the private_data structure in case one of the - * called dissectors modified it (and, due to the exception, - * was unable to restore it). - */ - pinfo->private_data = pd_save; show_exception(tvb, pinfo, h223_tree, EXCEPT_CODE, GET_MESSAGE); } diff --git a/epan/dissectors/packet-ieee8023.c b/epan/dissectors/packet-ieee8023.c index 6747f18c4b..78e1696393 100644 --- a/epan/dissectors/packet-ieee8023.c +++ b/epan/dissectors/packet-ieee8023.c @@ -47,7 +47,6 @@ dissect_802_3(volatile int length, gboolean is_802_2, tvbuff_t *tvb, tvbuff_t *trailer_tvb = NULL; const char *saved_proto; gint captured_length, reported_length; - void *pd_save; length_it = proto_tree_add_uint(fh_tree, length_id, tvb, offset_after_length - 2, 2, length); @@ -81,7 +80,6 @@ dissect_802_3(volatile int length, gboolean is_802_2, tvbuff_t *tvb, exception was thrown, we can still put in an item for the trailer. */ saved_proto = pinfo->current_proto; - pd_save = pinfo->private_data; TRY { if (is_802_2) call_dissector(llc_handle, next_tvb, pinfo, tree); @@ -104,17 +102,13 @@ dissect_802_3(volatile int length, gboolean is_802_2, tvbuff_t *tvb, Just show the exception and then drive on to show the trailer, after noting that a dissector was found and restoring the protocol value that was in effect before we called the subdissector. */ - pinfo->private_data = pd_save; - show_exception(next_tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; /* Restore the protocol value, so that any exception thrown by tvb_new_subset_remaining() refers to the protocol for which - this is a trailer, and restore the private_data structure in - case one of the called dissectors modified it. */ - pinfo->private_data = pd_save; + this is a trailer. */ pinfo->current_proto = saved_proto; /* Construct a tvbuff for the trailer; if the trailer is past the diff --git a/epan/dissectors/packet-infiniband.c b/epan/dissectors/packet-infiniband.c index 7602f9e5b4..17eadc37e1 100644 --- a/epan/dissectors/packet-infiniband.c +++ b/epan/dissectors/packet-infiniband.c @@ -2490,7 +2490,6 @@ static void parse_PAYLOAD(proto_tree *parentTree, * call the appropriate dissector. If not we call the "data" dissector. */ if (!dissector_found && pref_identify_iba_payload && (reserved == 0)) { - void *pd_save; /* Get the captured length and reported length of the data after the Ethernet type. */ @@ -2504,7 +2503,6 @@ static void parse_PAYLOAD(proto_tree *parentTree, was reduced by some dissector before an exception was thrown, we can still put in an item for the trailer. */ saved_proto = pinfo->current_proto; - pd_save = pinfo->private_data; TRY { dissector_found = dissector_try_uint(ethertype_dissector_table, @@ -2521,11 +2519,7 @@ static void parse_PAYLOAD(proto_tree *parentTree, the trailer, after noting that a dissector was found and restoring the protocol value that was in effect before we called the subdissector. - - Restore the private_data structure in case one of the - called dissectors modified it (and, due to the exception, - was unable to restore it). */ - pinfo->private_data = pd_save; + */ show_exception(next_tvb, pinfo, top_tree, EXCEPT_CODE, GET_MESSAGE); dissector_found = TRUE; diff --git a/epan/dissectors/packet-isl.c b/epan/dissectors/packet-isl.c index fecfe7e054..d59521b3d4 100644 --- a/epan/dissectors/packet-isl.c +++ b/epan/dissectors/packet-isl.c @@ -154,7 +154,6 @@ dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int fcs_len) tvbuff_t *volatile next_tvb; tvbuff_t *volatile trailer_tvb = NULL; const char *saved_proto; - void *pd_save; col_set_str(pinfo->cinfo, COL_PROTOCOL, "ISL"); col_clear(pinfo->cinfo, COL_INFO); @@ -276,7 +275,6 @@ dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int fcs_len) before an exception was thrown, we can still put in an item for the trailer. */ saved_proto = pinfo->current_proto; - pd_save = pinfo->private_data; TRY { /* Frames encapsulated in ISL include an FCS. */ call_dissector(eth_withfcs_handle, next_tvb, pinfo, tree); @@ -289,11 +287,7 @@ dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int fcs_len) Show the exception, and then drive on to show the trailer, restoring the protocol value that was in effect before we called the subdissector. - - Restore the private_data structure in case one of the - called dissectors modified it (and, due to the exception, - was unable to restore it). */ - pinfo->private_data = pd_save; + */ show_exception(next_tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); pinfo->current_proto = saved_proto; diff --git a/epan/dissectors/packet-ldp.c b/epan/dissectors/packet-ldp.c index 52d8c0fbf8..c974c89e28 100644 --- a/epan/dissectors/packet-ldp.c +++ b/epan/dissectors/packet-ldp.c @@ -3104,8 +3104,6 @@ dissect_ldp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data guint16 plen; int length; tvbuff_t *volatile next_tvb; - void *pd_save; - while (tvb_reported_length_remaining(tvb, offset) != 0) { length_remaining = tvb_length_remaining(tvb, offset); @@ -3220,16 +3218,10 @@ dissect_ldp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data * stop dissecting PDUs within this frame or chunk of reassembled * data. */ - pd_save = pinfo->private_data; TRY { dissect_ldp_pdu(next_tvb, pinfo, tree); } CATCH_NONFATAL_ERRORS { - /* Restore the private_data structure in case one of the - * called dissectors modified it (and, due to the exception, - * was unable to restore it). - */ - pinfo->private_data = pd_save; show_exception(tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; diff --git a/epan/dissectors/packet-nbns.c b/epan/dissectors/packet-nbns.c index 6d7bdfdb9c..aca719243d 100644 --- a/epan/dissectors/packet-nbns.c +++ b/epan/dissectors/packet-nbns.c @@ -1381,7 +1381,6 @@ dissect_nbss_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 error_code; tvbuff_t *next_tvb; const char *saved_proto; - void *pd_save; static const int * nbss_flags[] = { &hf_nbss_flags_e, NULL @@ -1479,16 +1478,10 @@ dissect_nbss_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * data. */ saved_proto = pinfo->current_proto; - pd_save = pinfo->private_data; TRY { dissect_netbios_payload(next_tvb, pinfo, tree); } CATCH_NONFATAL_ERRORS { - /* Restore the private_data structure in case one of the - * called dissectors modified it (and, due to the exception, - * was unable to restore it). - */ - pinfo->private_data = pd_save; show_exception(tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); pinfo->current_proto = saved_proto; } diff --git a/epan/dissectors/packet-ntlmssp.c b/epan/dissectors/packet-ntlmssp.c index 8ad765edf4..b1e242fedd 100644 --- a/epan/dissectors/packet-ntlmssp.c +++ b/epan/dissectors/packet-ntlmssp.c @@ -1957,7 +1957,6 @@ dissect_ntlmssp_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi guint32 ntlm_magic_size = 4; guint32 ntlm_signature_size = 8; guint32 ntlm_seq_size = 4; - void *pd_save; length = tvb_length (tvb); /* signature + seq + real payload */ @@ -1991,7 +1990,6 @@ dissect_ntlmssp_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi * in the packet after our blob to see, so we just re-throw the * exception. */ - pd_save = pinfo->private_data; TRY { /* Version number */ proto_tree_add_item (ntlmssp_tree, hf_ntlmssp_verf_vers, @@ -2010,11 +2008,6 @@ dissect_ntlmssp_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi offset += 12; } CATCH_NONFATAL_ERRORS { - /* Restore the private_data structure in case one of the - * called dissectors modified it (and, due to the exception, - * was unable to restore it). - */ - pinfo->private_data = pd_save; show_exception(tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; @@ -2137,7 +2130,6 @@ dissect_ntlmssp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree *volatile ntlmssp_tree = NULL; proto_item *tf, *type_item; ntlmssp_header_t *ntlmssph; - void *pd_save; ntlmssph = wmem_new(wmem_packet_scope(), ntlmssp_header_t); ntlmssph->type = 0; @@ -2165,7 +2157,6 @@ dissect_ntlmssp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * in the packet after our blob to see, so we just re-throw the * exception. */ - pd_save = pinfo->private_data; TRY { /* NTLMSSP constant */ proto_tree_add_item (ntlmssp_tree, hf_ntlmssp_auth, @@ -2204,11 +2195,7 @@ dissect_ntlmssp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; } } CATCH_NONFATAL_ERRORS { - /* Restore the private_data structure in case one of the - * called dissectors modified it (and, due to the exception, - * was unable to restore it). - */ - pinfo->private_data = pd_save; + show_exception(tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; @@ -2400,7 +2387,6 @@ dissect_ntlmssp_payload_only(tvbuff_t *tvb, packet_info *pinfo, _U_ proto_tree * volatile int offset = 0; proto_tree *volatile ntlmssp_tree = NULL; guint32 encrypted_block_length; - void *pd_save; /* the magic ntlm is the identifier of a NTLMSSP packet that's 00 00 00 01 */ @@ -2430,7 +2416,6 @@ dissect_ntlmssp_payload_only(tvbuff_t *tvb, packet_info *pinfo, _U_ proto_tree * * in the packet after our blob to see, so we just re-throw the * exception. */ - pd_save = pinfo->private_data; TRY { /* Version number */ @@ -2439,11 +2424,7 @@ dissect_ntlmssp_payload_only(tvbuff_t *tvb, packet_info *pinfo, _U_ proto_tree * /* let's try to hook ourselves here */ } CATCH_NONFATAL_ERRORS { - /* Restore the private_data structure in case one of the - * called dissectors modified it (and, due to the exception, - * was unable to restore it). - */ - pinfo->private_data = pd_save; + show_exception(tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; @@ -2461,7 +2442,6 @@ dissect_ntlmssp_verf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * proto_item *tf = NULL; guint32 verifier_length; guint32 encrypted_block_length; - void *pd_save; verifier_length = tvb_length (tvb); encrypted_block_length = verifier_length - 4; @@ -2494,7 +2474,6 @@ dissect_ntlmssp_verf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * * in the packet after our blob to see, so we just re-throw the * exception. */ - pd_save = pinfo->private_data; TRY { /* Version number */ proto_tree_add_item (ntlmssp_tree, hf_ntlmssp_verf_vers, @@ -2512,11 +2491,7 @@ dissect_ntlmssp_verf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * offset += 12; offset += encrypted_block_length; } CATCH_NONFATAL_ERRORS { - /* Restore the private_data structure in case one of the - * called dissectors modified it (and, due to the exception, - * was unable to restore it). - */ - pinfo->private_data = pd_save; + show_exception(tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c index 1aaeacb120..cf3faeeadb 100644 --- a/epan/dissectors/packet-rpc.c +++ b/epan/dissectors/packet-rpc.c @@ -3004,11 +3004,9 @@ call_message_dissector(tvbuff_t *tvb, tvbuff_t *rec_tvb, packet_info *pinfo, { const char *saved_proto; volatile gboolean rpc_succeeded; - void *pd_save; saved_proto = pinfo->current_proto; rpc_succeeded = FALSE; - pd_save = pinfo->private_data; TRY { rpc_succeeded = (*dissector)(rec_tvb, pinfo, tree, frag_tvb, ipfd_head, TRUE, rpc_rm, first_pdu); @@ -3026,12 +3024,6 @@ call_message_dissector(tvbuff_t *tvb, tvbuff_t *rec_tvb, packet_info *pinfo, show_exception(tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); pinfo->current_proto = saved_proto; - /* Restore the private_data structure in case one of the - * called dissectors modified it (and, due to the exception, - * was unable to restore it). - */ - pinfo->private_data = pd_save; - /* * We treat this as a "successful" dissection of * an RPC packet, as "dissect_rpc_message()" diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c index 085377fe49..3e0783b4d2 100644 --- a/epan/dissectors/packet-sctp.c +++ b/epan/dissectors/packet-sctp.c @@ -3328,10 +3328,8 @@ dissect_data_chunk(tvbuff_t *chunk_tvb, if (call_subdissector) { /* This isn't a fragment or reassembly is off and it's the first fragment */ - void *pd_save; volatile gboolean retval = FALSE; - pd_save = pinfo->private_data; TRY { wmem_list_frame_t *cur; guint proto_id; @@ -3356,12 +3354,7 @@ dissect_data_chunk(tvbuff_t *chunk_tvb, * protocol or info columns. * * Just show the exception and then continue dissecting chunks. - * - * Restore the private_data structure in case one of the - * called dissectors modified it (and, due to the exception, - * was unable to restore it). */ - pinfo->private_data = pd_save; show_exception(payload_tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; diff --git a/epan/dissectors/packet-sflow.c b/epan/dissectors/packet-sflow.c index 052636bfb8..654cd1e0a6 100644 --- a/epan/dissectors/packet-sflow.c +++ b/epan/dissectors/packet-sflow.c @@ -632,7 +632,6 @@ dissect_sflow_245_sampled_header(tvbuff_t *tvb, packet_info *pinfo, gboolean save_writable; gboolean save_in_error_pkt; address save_dl_src, save_dl_dst, save_net_src, save_net_dst, save_src, save_dst; - void *pd_save; version = tvb_get_ntohl(tvb, 0); header_proto = tvb_get_ntohl(tvb, offset); @@ -695,7 +694,6 @@ dissect_sflow_245_sampled_header(tvbuff_t *tvb, packet_info *pinfo, save_net_dst = pinfo->net_dst; save_src = pinfo->src; save_dst = pinfo->dst; - pd_save = pinfo->private_data; TRY { @@ -707,11 +705,6 @@ dissect_sflow_245_sampled_header(tvbuff_t *tvb, packet_info *pinfo, } CATCH_BOUNDS_ERRORS { - /* Restore the private_data structure in case one of the - * called dissectors modified it (and, due to the exception, - * was unable to restore it). - */ - pinfo->private_data = pd_save; } ENDTRY; diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c index b3aeb20bf4..f801e42955 100644 --- a/epan/dissectors/packet-tcp.c +++ b/epan/dissectors/packet-tcp.c @@ -2271,7 +2271,6 @@ tcp_dissect_pdus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, tvbuff_t *next_tvb; proto_item *item=NULL; const char *saved_proto; - void *pd_save; while (tvb_reported_length_remaining(tvb, offset) > 0) { /* @@ -2416,7 +2415,6 @@ tcp_dissect_pdus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * data. */ saved_proto = pinfo->current_proto; - pd_save = pinfo->private_data; TRY { (*dissect_pdu)(next_tvb, pinfo, tree, dissector_data); } @@ -2425,7 +2423,6 @@ tcp_dissect_pdus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * called dissectors modified it (and, due to the exception, * was unable to restore it). */ - pinfo->private_data = pd_save; show_exception(tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); /* diff --git a/epan/dissectors/packet-tcp.h b/epan/dissectors/packet-tcp.h index f1b34738a1..13d3172cda 100644 --- a/epan/dissectors/packet-tcp.h +++ b/epan/dissectors/packet-tcp.h @@ -77,8 +77,7 @@ typedef struct tcpheader { } tcp_info_t; /* - * Private data passed from the TCP dissector to subdissectors. Passed to the - * subdissectors in pinfo->private_data + * Private data passed from the TCP dissector to subdissectors. */ struct tcpinfo { guint32 seq; /* Sequence number of first byte in the data */ diff --git a/epan/dissectors/packet-tds.c b/epan/dissectors/packet-tds.c index 63cea70939..2be96a09bd 100644 --- a/epan/dissectors/packet-tds.c +++ b/epan/dissectors/packet-tds.c @@ -2444,7 +2444,6 @@ dissect_tds_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tvbuff_t *volatile next_tvb; proto_item *tds_item = NULL; proto_tree *tds_tree = NULL; - void *pd_save; while (tvb_reported_length_remaining(tvb, offset) != 0) { length_remaining = tvb_ensure_length_remaining(tvb, offset); @@ -2571,16 +2570,10 @@ dissect_tds_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * we should stop dissecting Netlib buffers within this frame * or chunk of reassembled data. */ - pd_save = pinfo->private_data; TRY { dissect_netlib_buffer(next_tvb, pinfo, tree); } CATCH_NONFATAL_ERRORS { - /* Restore the private_data structure in case one of the - * called dissectors modified it (and, due to the exception, - * was unable to restore it). - */ - pinfo->private_data = pd_save; show_exception(tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); } diff --git a/epan/dissectors/packet-tpkt.c b/epan/dissectors/packet-tpkt.c index 4ba011ba9e..e4e4f54bfe 100644 --- a/epan/dissectors/packet-tpkt.c +++ b/epan/dissectors/packet-tpkt.c @@ -219,7 +219,6 @@ dissect_asciitpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, tvbuff_t *volatile next_tvb; const char *saved_proto; guint8 string[4]; - void *pd_save; /* * If we're reassembling segmented TPKT PDUs, empty the COL_INFO @@ -334,17 +333,11 @@ dissect_asciitpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * we should stop dissecting TPKT messages within this frame * or chunk of reassembled data. */ - pd_save = pinfo->private_data; TRY { call_dissector(subdissector_handle, next_tvb, pinfo, tree); } CATCH_NONFATAL_ERRORS { - /* Restore the private_data structure in case one of the - * called dissectors modified it (and, due to the exception, - * was unable to restore it). - */ - pinfo->private_data = pd_save; show_exception(tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); } @@ -372,7 +365,6 @@ dissect_tpkt_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, volatile int length; tvbuff_t *volatile next_tvb; const char *saved_proto; - void *pd_save; /* * If we're reassembling segmented TPKT PDUs, empty the COL_INFO @@ -546,18 +538,11 @@ dissect_tpkt_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, * messages within this frame or chunk of reassembled * data. */ - pd_save = pinfo->private_data; TRY { call_dissector(subdissector_handle, next_tvb, pinfo, tree); } CATCH_NONFATAL_ERRORS { - /* Restore the private_data structure in case one of the - * called dissectors modified it (and, due to the exception, - * was unable to restore it). - */ - pinfo->private_data = pd_save; - show_exception(tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE); } ENDTRY; diff --git a/epan/dissectors/packet-websocket.c b/epan/dissectors/packet-websocket.c index 56ee6cc794..fe3f7d05c7 100644 --- a/epan/dissectors/packet-websocket.c +++ b/epan/dissectors/packet-websocket.c @@ -208,10 +208,8 @@ dissect_websocket_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, p PROTO_ITEM_SET_HIDDEN(ti_unmask); } else { const gchar *saved_match_string = pinfo->match_string; - void *save_private_data = pinfo->private_data; pinfo->match_string = NULL; - pinfo->private_data = NULL; switch (pref_text_type) { case WEBSOCKET_TEXT: call_dissector(text_lines_handle, payload_tvb, pinfo, pl_tree); @@ -229,7 +227,6 @@ dissect_websocket_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, p break; } pinfo->match_string = saved_match_string; - pinfo->private_data = save_private_data; } offset += payload_length; break; -- cgit v1.2.3