Thread (13 messages) flat view 13 messages, 4 authors, 2016-08-22

Re: [PATCH 2/3] vsockmon: Add vsockmon device.

From: Stefan Hajnoczi <stefanha@redhat.com>
Date: 2016-08-10 19:01:23

On Mon, Aug 08, 2016 at 06:14:41PM +0200, ggarcia@abra.uab.cat wrote:
quoted hunk ↗ jump to hunk
diff --git a/include/uapi/linux/vsockmon.h b/include/uapi/linux/vsockmon.h
new file mode 100644
index 0000000..739b4bf
--- /dev/null
+++ b/include/uapi/linux/vsockmon.h
@@ -0,0 +1,35 @@
+#ifndef _UAPI_VSOCKMON_H
+#define _UAPI_VSOCKMON_H
+
+#include <linux/virtio_vsock.h>
+
+/* Structure of packets received trought the vsockmon device. */
+
+struct af_vsockmon_hdr {
+	__le64 src_cid;
+	__le64 dst_cid;
+	__le32 src_port;
+	__le32 dst_port;
+	__le16 op;			/* enum af_vsockmon_op */
+	__le16 t;			/* enum af_vosckmon_t */
+	__le16 len;			/* sizeof(t_hdr) */
+	union {
+		struct virtio_vsock_hdr virtio_hdr;
+	} t_hdr;
+} __attribute__((packed));
This struct will change in size if/when VMCI transport support is added.
Existing binaries that were complied against the old header file would
use an incorrect size.

It would be cleaner to drop t_hdr from the struct and force users to
explicitly use af_vsockmon_hdr.len to handle the size of the headers.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help