From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeobL-0001GF-K5 for qemu-devel@nongnu.org; Fri, 08 Nov 2013 11:08:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VeobD-0001D8-S3 for qemu-devel@nongnu.org; Fri, 08 Nov 2013 11:08:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeobD-0001Cp-Jv for qemu-devel@nongnu.org; Fri, 08 Nov 2013 11:07:55 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rA8G7sMk016375 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 8 Nov 2013 11:07:54 -0500 From: Vlad Yasevich Date: Fri, 8 Nov 2013 11:07:49 -0500 Message-Id: <1383926869-5518-1-git-send-email-vyasevic@redhat.com> Subject: [Qemu-devel] [PATCH] virtio-net: Correctly store multicast filter entries List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Vlad Yasevich , mst@redhat.com Commit 921ac5d0f3a0df869db5ce4edf752f51d8b1596a virtio-net: remove layout assumptions for ctrl vq introduced a regression where the multicast address filter entries are written to the beginning of the mac table array, thus overwriting any unicast addresses that may have been programmed in the filter. The multicast addresses should be written after all the unicast addresses. Signed-off-by: Vlad Yasevich --- hw/net/virtio-net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 22dbd05..94e8b68 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -657,7 +657,8 @@ static int virtio_net_handle_mac(VirtIONet *n, uint8_t cmd, } if (n->mac_table.in_use + mac_data.entries <= MAC_TABLE_ENTRIES) { - s = iov_to_buf(iov, iov_cnt, 0, n->mac_table.macs, + s = iov_to_buf(iov, iov_cnt, 0, + n->mac_table.macs + (n->mac_table.in_use * ETH_ALEN), mac_data.entries * ETH_ALEN); if (s != mac_data.entries * ETH_ALEN) { goto error; -- 1.8.4.2