qemu-devel
[Top][All Lists]
Advanced

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

[PATCH v1 1/2] colo-compare: Fix incorrect data type conversion


From: Derek Su
Subject: [PATCH v1 1/2] colo-compare: Fix incorrect data type conversion
Date: Fri, 11 Sep 2020 19:05:07 +0000

Fix data type conversion of compare_timeout. The incorrect
conversion results in a random compare_timeout value and
unexpected stalls in packet comparison.

Signed-off-by: Derek Su <dereksu@qnap.com>
---
 net/colo-compare.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/colo-compare.c b/net/colo-compare.c
index 2c20de1537..c4de86ef34 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -619,11 +619,12 @@ static int colo_packet_compare_other(Packet *spkt, Packet 
*ppkt)
                                        ppkt->size - offset);
 }
 
-static int colo_old_packet_check_one(Packet *pkt, int64_t *check_time)
+static int colo_old_packet_check_one(Packet *pkt, void *user_data)
 {
     int64_t now = qemu_clock_get_ms(QEMU_CLOCK_HOST);
+    uint32_t check_time = *(uint32_t *)user_data;
 
-    if ((now - pkt->creation_ms) > (*check_time)) {
+    if ((now - pkt->creation_ms) > check_time) {
         trace_colo_old_packet_check_found(pkt->creation_ms);
         return 0;
     } else {
-- 
2.25.1




reply via email to

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