From 1f59c187691761ef28837c1caf1c68a1a5cf7072 Mon Sep 17 00:00:00 2001 From: David Perry Date: Mon, 13 Feb 2023 15:11:46 -0500 Subject: Change some `wmem_packet_scope()` to `pinfo->pool` As requested [here][1] by @eapache, help with removing calls to `wmem_packet_scope()` in favour of references to `pinfo->pool`. * Plugins chosen semi-randomly. * When a calling function already has a `pinfo` argument, use that. * Remove `_U_` from its signature if it was there. * If a function seems narrowly focused on getting and (possibly) returning memory, change the function signature to take a `wmem_allocator_t *`. * If it seems more focused on packet-based operations, pass in a `packet_info *` instead and use `pinfo->pool` within. * If there are several functions defined with the same call signature, add `pinfo _U_` to the argument list of similar functions in order to maintain clarity/symmetry. [1]: https://www.wireshark.org/lists/wireshark-dev/202107/msg00052.html --- epan/dissectors/packet-bpv6.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'epan/dissectors/packet-bpv6.c') diff --git a/epan/dissectors/packet-bpv6.c b/epan/dissectors/packet-bpv6.c index 4a66ff9683..ed53a6774d 100644 --- a/epan/dissectors/packet-bpv6.c +++ b/epan/dissectors/packet-bpv6.c @@ -1970,11 +1970,11 @@ dissect_bundle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ } } - wscbor_chunk_t *frame = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset); + wscbor_chunk_t *frame = wscbor_chunk_read(pinfo->pool, tvb, &offset); if (frame->type_major == CBOR_TYPE_ARRAY) { - wscbor_chunk_t *primary = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset); + wscbor_chunk_t *primary = wscbor_chunk_read(pinfo->pool, tvb, &offset); if (primary->type_major == CBOR_TYPE_ARRAY) { - wscbor_chunk_t *version = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset); + wscbor_chunk_t *version = wscbor_chunk_read(pinfo->pool, tvb, &offset); if (version->type_major == CBOR_TYPE_UINT) { guint64 vers_val = version->head_value; if (vers_val == 7) { -- cgit v1.2.3