From 206ad06b2e88a3d826c99da8c8b3ed98e287ad87 Mon Sep 17 00:00:00 2001
From: Rusty Russell <rusty@rustcorp.com.au>
Date: Fri, 13 Feb 2015 17:13:44 +1030
Subject: [PATCH] tools/lguest: don't use legacy definitions for net device in
 example launcher.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 tools/lguest/lguest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/lguest/lguest.c b/tools/lguest/lguest.c
index eebe94b84e8c..e44052483ed9 100644
--- a/tools/lguest/lguest.c
+++ b/tools/lguest/lguest.c
@@ -66,6 +66,7 @@ typedef uint8_t u8;
 #define VIRTIO_CONFIG_NO_LEGACY
 #define VIRTIO_PCI_NO_LEGACY
 #define VIRTIO_BLK_NO_LEGACY
+#define VIRTIO_NET_NO_LEGACY
 
 /* Use in-kernel ones, which defines VIRTIO_F_VERSION_1 */
 #include "../../include/uapi/linux/virtio_config.h"
@@ -2816,7 +2817,7 @@ static int get_tun_device(char tapif[IFNAMSIZ])
 	 * about our expanded header (which is called
 	 * virtio_net_hdr_mrg_rxbuf in the legacy system).
 	 */
-	vnet_hdr_sz = sizeof(struct virtio_net_hdr_mrg_rxbuf);
+	vnet_hdr_sz = sizeof(struct virtio_net_hdr_v1);
 	if (ioctl(netfd, TUNSETVNETHDRSZ, &vnet_hdr_sz) != 0)
 		err(1, "Setting tun header size to %u", vnet_hdr_sz);