qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] Remove VLAN client on network connection close


From: Boris Sukholitko
Subject: [Qemu-devel] [PATCH] Remove VLAN client on network connection close
Date: Mon, 23 Nov 2009 14:23:03 +0200

Hi,

I am seeing funny QEMU behaviour when using "-net socket,listen"
mechanism.

When connecting and disconnecting several clients I start
to get duplicated packets from QEMU server.

IMHO, the following is happenning:
1. Client is disconnected: we get into net_socket_send callback.
2. net_socket_send does closesocket on the fd.
3. Note, that VLANClientState is not being removed.
4. New client is getting the same fd as the old client.
5. At this stage we have two VLANClientState's with the same fd.
6. From now on, every packet is being sent twice by qemu_vlan_deliver_packet.

It seems that the fix would be to qemu_del_vlan_client on stage 3. It certainly
fixes my problem.

Thanks,
Boris.

PS. Please CC me as I am not subscribed to the list.

Signed-off-by: Boris Sukholitko <address@hidden>
---
diff --git a/net.c b/net.c
index 9ea66e3..951b9a4 100644
--- a/net.c
+++ b/net.c
@@ -1440,6 +1440,7 @@ static void net_socket_send(void *opaque)
     eoc:
         qemu_set_fd_handler(s->fd, NULL, NULL, NULL);
         closesocket(s->fd);
+        qemu_del_vlan_client(s->vc);
         return;
     }
     buf = buf1;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]