summaryrefslogtreecommitdiff
path: root/tap-win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'tap-win32.c')
-rw-r--r--tap-win32.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/tap-win32.c b/tap-win32.c
index 3279644236..7759633059 100644
--- a/tap-win32.c
+++ b/tap-win32.c
@@ -639,6 +639,18 @@ static int tap_win32_open(tap_win32_overlapped_t **phandle,
tap_win32_overlapped_t *handle;
} TAPState;
+static void tap_cleanup(VLANClientState *vc)
+{
+ TAPState *s = vc->opaque;
+
+ qemu_del_wait_object(s->handle->tap_semaphore, NULL, NULL);
+
+ /* FIXME: need to kill thread and close file handle:
+ tap_win32_close(s);
+ */
+ qemu_free(s);
+}
+
static void tap_receive(void *opaque, const uint8_t *buf, int size)
{
TAPState *s = opaque;
@@ -673,7 +685,8 @@ int tap_win32_init(VLANState *vlan, const char *model,
return -1;
}
- s->vc = qemu_new_vlan_client(vlan, model, name, tap_receive, NULL, s);
+ s->vc = qemu_new_vlan_client(vlan, model, name, tap_receive,
+ NULL, tap_cleanup, s);
snprintf(s->vc->info_str, sizeof(s->vc->info_str),
"tap: ifname=%s", ifname);