32 lines
1.2 KiB
Diff
32 lines
1.2 KiB
Diff
|
|
From b7db1c20c9f80154fb54392eb44add3486d3e427 Mon Sep 17 00:00:00 2001
|
||
|
|
From: Uri Lublin <uril@redhat.com>
|
||
|
|
Date: Sun, 11 Oct 2020 20:59:17 +0300
|
||
|
|
Subject: [PATCH] vdagentd: do not allow to use an already used file-xfer id
|
||
|
|
|
||
|
|
Signed-off-by: Uri Lublin <uril@redhat.com>
|
||
|
|
Acked-by: Frediano Ziglio <fziglio@redhat.com>
|
||
|
|
---
|
||
|
|
src/vdagentd/vdagentd.c | 7 +++++++
|
||
|
|
1 file changed, 7 insertions(+)
|
||
|
|
|
||
|
|
diff --git a/src/vdagentd/vdagentd.c b/src/vdagentd/vdagentd.c
|
||
|
|
index 8437779..78378aa 100644
|
||
|
|
--- a/src/vdagentd/vdagentd.c
|
||
|
|
+++ b/src/vdagentd/vdagentd.c
|
||
|
|
@@ -404,6 +404,13 @@ static void do_client_file_xfer(VirtioPort *vport,
|
||
|
|
"Cancelling client file-xfer request %u",
|
||
|
|
s->id, VD_AGENT_FILE_XFER_STATUS_ERROR, NULL, 0);
|
||
|
|
return;
|
||
|
|
+ } else if (g_hash_table_lookup(active_xfers, GUINT_TO_POINTER(s->id)) != NULL) {
|
||
|
|
+ // id is already used -- client is confused
|
||
|
|
+ send_file_xfer_status(vport,
|
||
|
|
+ "File transfer ID is already used. "
|
||
|
|
+ "Cancelling client file-xfer request %u",
|
||
|
|
+ s->id, VD_AGENT_FILE_XFER_STATUS_ERROR, NULL, 0);
|
||
|
|
+ return;
|
||
|
|
}
|
||
|
|
msg_type = VDAGENTD_FILE_XFER_START;
|
||
|
|
id = s->id;
|
||
|
|
--
|
||
|
|
GitLab
|