aboutsummaryrefslogtreecommitdiff
path: root/net.h
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2009-08-26 12:47:04 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-09-04 09:37:27 -0500
commit9da4318706a37d92f8e616a37997d621612b1f7d (patch)
treea66b8d85b44618eb3ddddcf8478f2039908fce7e /net.h
parent4e2f73ce3d70083dacb99815c9633af48aae32b4 (diff)
net: Fix send queue ordering
Ensure that packets enqueued for delayed delivery are dequeued in FIFO order. At least one simplistic guest TCP/IP stack became unhappy due to sporadically reordered packet streams. At this chance, switch the send queue implementation to TAILQ. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'net.h')
-rw-r--r--net.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/net.h b/net.h
index 3ac9e8c968..bab02f5de9 100644
--- a/net.h
+++ b/net.h
@@ -1,6 +1,7 @@
#ifndef QEMU_NET_H
#define QEMU_NET_H
+#include "sys-queue.h"
#include "qemu-common.h"
/* VLANs support */
@@ -35,7 +36,7 @@ typedef struct VLANPacket VLANPacket;
typedef void (NetPacketSent) (VLANClientState *, ssize_t);
struct VLANPacket {
- struct VLANPacket *next;
+ TAILQ_ENTRY(VLANPacket) entry;
VLANClientState *sender;
int size;
NetPacketSent *sent_cb;
@@ -47,7 +48,7 @@ struct VLANState {
VLANClientState *first_client;
struct VLANState *next;
unsigned int nb_guest_devs, nb_host_devs;
- VLANPacket *send_queue;
+ TAILQ_HEAD(send_queue, VLANPacket) send_queue;
int delivering;
};