vsock: add missing vsockmon header reserved field

The vsockmon packet header is defined in <linux/vsockmon.h> 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 <stefanha@redhat.com>
Reviewed-on: https://code.wireshark.org/review/22612
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
This commit is contained in:
Stefan Hajnoczi 2017-07-13 13:54:19 +01:00 committed by Alexis La Goutte
parent 41415aa444
commit 73d9550ad6
1 changed files with 7 additions and 0 deletions

View File

@ -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}},