aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-vlan.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2020-04-14 16:04:09 -0700
committerAnders Broman <a.broman58@gmail.com>2020-04-15 04:09:08 +0000
commit6a8c1b9b932d70428356ca35da653d943e799546 (patch)
tree514f7bcd3ea890fb0cc9bcda5b87ef5b07463463 /epan/dissectors/packet-vlan.c
parente9e90f67b7ef5c3d7b262817d76b817de23e89b6 (diff)
epan: Add p_[gs]et_proto_depth.
Add convenience routines for getting and setting a per-protocol, per-packet depth value, which can be used to limit recursion, nesting, cycling, etc. Use them in the BACapp, DAAP, Mongo, VLAN, and WBXML dissectors. Change-Id: I172514828169253ae7fcf9162c9d7eeb3041ff9c Reviewed-on: https://code.wireshark.org/review/36846 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-vlan.c')
-rw-r--r--epan/dissectors/packet-vlan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-vlan.c b/epan/dissectors/packet-vlan.c
index 4e1ea5e645..13b0571ec8 100644
--- a/epan/dissectors/packet-vlan.c
+++ b/epan/dissectors/packet-vlan.c
@@ -262,12 +262,12 @@ dissect_vlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
vlan_tree = NULL;
ti = proto_tree_add_item(tree, hfi_vlan, tvb, 0, 4, ENC_NA);
- vlan_nested_count = GPOINTER_TO_UINT(p_get_proto_data(pinfo->pool, pinfo, proto_vlan, 0));
+ vlan_nested_count = p_get_proto_depth(pinfo, proto_vlan);
if (++vlan_nested_count > VLAN_MAX_NESTED_TAGS) {
expert_add_info(pinfo, ti, &ei_vlan_too_many_tags);
return tvb_captured_length(tvb);
}
- p_add_proto_data(pinfo->pool, pinfo, proto_vlan, 0, GUINT_TO_POINTER(vlan_nested_count));
+ p_set_proto_depth(pinfo, proto_vlan, vlan_nested_count);
if (tree) {