From 73d9550ad6bab1b0c46dccb84434d90a755b2d15 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Thu, 13 Jul 2017 13:54:19 +0100 Subject: [PATCH] vsock: add missing vsockmon header reserved field The vsockmon packet header is defined in as follows: struct af_vsockmon_hdr { __le64 src_cid; __le64 dst_cid; __le32 src_port; __le32 dst_port; __le16 op; /* enum af_vsockmon_op */ __le16 transport; /* enum af_vsockmon_transport */ __le16 len; /* Transport header length */ __u8 reserved[2]; }; The vsock dissector forgot to include the 2-byte reserved field. This caused the transport header and payload that follow the vsockmon header to contain junk data. Change-Id: I0e7e6f1d9ad96ab339bd070c1becf43bc7e6a6b1 Signed-off-by: Stefan Hajnoczi Reviewed-on: https://code.wireshark.org/review/22612 Reviewed-by: Michael Mann Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte --- epan/dissectors/packet-vsock.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/epan/dissectors/packet-vsock.c b/epan/dissectors/packet-vsock.c index 0294f682f5..df415951d8 100644 --- a/epan/dissectors/packet-vsock.c +++ b/epan/dissectors/packet-vsock.c @@ -50,6 +50,7 @@ static int hf_vsock_dst_port = -1; static int hf_vsock_op = -1; static int hf_vsock_t = -1; static int hf_vsock_t_len = -1; +static int hf_vsock_reserved = -1; static int hf_vsock_payload = -1; /* Virtio related fields */ @@ -172,6 +173,9 @@ dissect_vsock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree_add_item_ret_uint(vsock_tree, hf_vsock_t_len, tvb, offset, 2, ENC_LITTLE_ENDIAN, &t_len); offset += 2; + proto_tree_add_item(vsock_tree, hf_vsock_reserved, tvb, offset, 2, ENC_NA); + offset += 2; + payload_offset = offset + t_len; /* Append summary information to top tree */ @@ -262,6 +266,9 @@ proto_register_vsock(void) { &hf_vsock_t_len, {"Transport length", "vsock.trans_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_vsock_reserved, + {"Reserved", "vsock.reserved", FT_BYTES, BASE_NONE, NULL, + 0x0, NULL, HFILL }}, { &hf_vsock_payload, { "Payload", "vsock.payload", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}},