aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe GUERBER <christophe.guerber@gmail.com>2018-12-17 23:59:16 +0100
committerAnders Broman <a.broman58@gmail.com>2018-12-18 09:25:45 +0000
commitc0a28448a57ca67892fdcd5c3fbc2d6f0182e310 (patch)
treef5eb893c6862aa783f4a130c6f8ea39207b524e2
parent6556f3748b79a1bf5c4562fb97b6f87a2612415d (diff)
Provide data to inner dissector for PER open type
When an open type is decoded in ASN.1 PER, one can define a dissector for the content of the open type. Providing data to the inner dissector is only possible through packet info private data or global vars. Use the private_data field from ASN.1 context as the data for the inner dissector. This avoids using packet info private data to communicate with the inner dissector, especially if the data to be provided are only "local" matter. Ping-Bug: 15148 Change-Id: I8fd2cb69d52e371e7d713afe2cc4b2856fb39f7c Reviewed-on: https://code.wireshark.org/review/31087 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/dissectors/packet-per.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c
index dd5ceee164..7ffb82d13b 100644
--- a/epan/dissectors/packet-per.c
+++ b/epan/dissectors/packet-per.c
@@ -231,7 +231,8 @@ dissect_per_open_type_internal(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx,
((per_type_fn)type_cb)(pdu_tvb, pdu_offset, actx, tree, hf_index);
break;
case CB_NEW_DISSECTOR:
- ((dissector_t)type_cb)(val_tvb, actx->pinfo, subtree, NULL);
+ /* Pas actx->private_data as "data" to the called function */
+ ((dissector_t)type_cb)(val_tvb, actx->pinfo, subtree, actx->private_data);
break;
case CB_DISSECTOR_HANDLE:
break;