[libvirt] [PATCH] wireshark: Adapt to tvb_new_subset() rename

Martin Kletzander mkletzan at redhat.com
Tue Jul 18 13:29:15 UTC 2017


On Tue, Jul 18, 2017 at 10:34:09AM +0200, Michal Privoznik wrote:
>In Wireshark commit of 7cd6906056922e4b8 (contained in v2.4.0)
>the tvb_new_subset() function was renamed to
>tvb_new_subset_length_caplen(). However, we can take the extra
>step and rename to tvb_new_subset_remaining() directly (see
>Wireshark commit 0ecfc7280cf3d7). The reasoning is that there is
>no other protocol in the packet than libvirt. Therefore, from the
>point that libvirt dissector takes over till the end of the
>packet it's all libvirt packet.
>
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> tools/wireshark/src/packet-libvirt.c | 5 +++++
> 1 file changed, 5 insertions(+)
>

WFM

Reviewed-by: Martin Kletzander <mkletzan at redhat.com>

>diff --git a/tools/wireshark/src/packet-libvirt.c b/tools/wireshark/src/packet-libvirt.c
>index a1f5a34f4..c15e9c340 100644
>--- a/tools/wireshark/src/packet-libvirt.c
>+++ b/tools/wireshark/src/packet-libvirt.c
>@@ -313,7 +313,12 @@ dissect_libvirt_payload_xdr_data(tvbuff_t *tvb, proto_tree *tree, gint payload_l
>         payload_length -= 4;
>     }
>
>+#if WIRESHARK_VERSION < 200400
>     payload_tvb = tvb_new_subset(tvb, start, -1, payload_length);
>+#else
>+    payload_tvb = tvb_new_subset_remaining(tvb, start);
>+#endif
>+
> #if WIRESHARK_VERSION < 1012000
>     payload_data = (caddr_t)tvb_memdup(payload_tvb, 0, payload_length);
> #else
>--
>2.13.0
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170718/0235f3d6/attachment-0001.sig>


More information about the libvir-list mailing list