From e398d61b4777125f32a99fa49519c5edbb00809b Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Wed, 29 Aug 2012 19:03:09 +0200 Subject: virtio-net: use qemu_get_buffer() in a temp buffer qemu_fseek() is known to be wrong. Would be removed on the next commit. This code should never been used (value has been MAC_TABLE_ENTRIES since 2009). Signed-off-by: Juan Quintela Reviewed-by: Paolo Bonzini --- hw/virtio-net.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'hw') diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 8342391..50ba728 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -921,7 +921,9 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id) qemu_get_buffer(f, n->mac_table.macs, n->mac_table.in_use * ETH_ALEN); } else if (n->mac_table.in_use) { - qemu_fseek(f, n->mac_table.in_use * ETH_ALEN, SEEK_CUR); + uint8_t *buf = g_malloc0(n->mac_table.in_use); + qemu_get_buffer(f, buf, n->mac_table.in_use * ETH_ALEN); + g_free(buf); n->mac_table.multi_overflow = n->mac_table.uni_overflow = 1; n->mac_table.in_use = 0; } -- cgit v1.1