]> xenbits.xensource.com Git - mini-os.git/commitdiff
Mini-OS: fix 9pfs response receiving
authorJuergen Gross <jgross@suse.com>
Tue, 21 Nov 2023 09:49:53 +0000 (10:49 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 21 Nov 2023 21:05:11 +0000 (21:05 +0000)
When copying a 9pfs response chunk from the ring buffer across the
ring end, the local ring pointer and length field are not updated
correctly. Fix that.

Fixes: 0924fec1de58 ("Mini-OS: add 9pfs transport layer")
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
9pfront.c

index 43c7409f790be3f4b4d55efe0702acc3a2574a28..35c5552b7e0f1c515d2200ad5ea1014a69bffd67 100644 (file)
--- a/9pfront.c
+++ b/9pfront.c
@@ -386,7 +386,9 @@ static void copy_bufs(unsigned char **buf1, unsigned char **buf2,
             printk("9pfs: short copy (dropping %u bytes)\n", len - *len1);
             len = *len1;
         }
-        memcpy(target, *buf1, *len1);
+        memcpy(target, *buf1, len);
+        *buf1 += len;
+        *len1 -= len;
     }
 }