diff options
author | Irene Ruengeler <ruengeler@wireshark.org> | 2017-05-08 09:04:16 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-06-02 01:19:02 +0000 |
commit | e1f84f985eb4920bc3c0b58ca583bca1d2e93b1c (patch) | |
tree | e105e10d80c825eae5c58e139736ab4d64f2be24 /epan/dissectors/packet-ethertype.c | |
parent | 653fc958979032009e0dd2bdfe2a23c338311805 (diff) |
Fix Decode As for protocols that may use tunneling.
Dissectors that rely on pinfo structure information may have the
data overwritten if the data is tunneled. Address it by using
proto data that is based on pinfo->curr_layer_num.
Bug: 13746
Change-Id: I1c29f26a3c49f368876f0e96908705bc9c099ce1
Reviewed-on: https://code.wireshark.org/review/21559
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-ethertype.c')
-rw-r--r-- | epan/dissectors/packet-ethertype.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ethertype.c b/epan/dissectors/packet-ethertype.c index 92fb9a0722..6f5a37e2c8 100644 --- a/epan/dissectors/packet-ethertype.c +++ b/epan/dissectors/packet-ethertype.c @@ -193,12 +193,12 @@ const value_string etype_vals[] = { static void eth_prompt(packet_info *pinfo, gchar* result) { g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Ethertype 0x%04x as", - GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_ethertype, 0))); + GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_ethertype, pinfo->curr_layer_num))); } static gpointer eth_value(packet_info *pinfo) { - return p_get_proto_data(pinfo->pool, pinfo, proto_ethertype, 0); + return p_get_proto_data(pinfo->pool, pinfo, proto_ethertype, pinfo->curr_layer_num); } static void add_dix_trailer(packet_info *pinfo, proto_tree *tree, proto_tree *fh_tree, @@ -257,7 +257,7 @@ dissect_ethertype(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat next_tvb = tvb_new_subset_length_caplen(tvb, ethertype_data->offset_after_ethertype, captured_length, reported_length); - p_add_proto_data(pinfo->pool, pinfo, proto_ethertype, 0, GUINT_TO_POINTER((guint)ethertype_data->etype)); + p_add_proto_data(pinfo->pool, pinfo, proto_ethertype, pinfo->curr_layer_num, GUINT_TO_POINTER((guint)ethertype_data->etype)); /* Look for sub-dissector, and call it if found. Catch exceptions, so that if the reported length of "next_tvb" |