diff options
author | David Perry <boolean263@protonmail.com> | 2023-02-13 15:11:46 -0500 |
---|---|---|
committer | John Thacker <johnthacker@gmail.com> | 2023-02-25 05:32:48 +0000 |
commit | 1f59c187691761ef28837c1caf1c68a1a5cf7072 (patch) | |
tree | 154f86dc433ce86d752984b94102f647a42cf4ff /epan/dissectors/packet-bpv6.c | |
parent | 39aa3cb58af77a91e05972a440d35fbb93d4273d (diff) |
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
Diffstat (limited to 'epan/dissectors/packet-bpv6.c')
-rw-r--r-- | epan/dissectors/packet-bpv6.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) { |