From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNlHy-0007I6-PP for qemu-devel@nongnu.org; Sun, 22 Sep 2013 11:09:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VNlHr-00039n-Ef for qemu-devel@nongnu.org; Sun, 22 Sep 2013 11:09:34 -0400 Received: from mail-we0-f170.google.com ([74.125.82.170]:57879) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNlHr-00039g-8j for qemu-devel@nongnu.org; Sun, 22 Sep 2013 11:09:27 -0400 Received: by mail-we0-f170.google.com with SMTP id w62so2222741wes.29 for ; Sun, 22 Sep 2013 08:09:26 -0700 (PDT) From: Dmitry Fleytman Date: Sun, 22 Sep 2013 18:09:13 +0300 Message-Id: <1379862553-26307-1-git-send-email-dmitry@daynix.com> Subject: [Qemu-devel] [PATCH] virtio-net: broken RX filtering logic fixed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Yan Vugenfirer , Stefan Hajnoczi , Ronen Hod , Anthony Liguori From: Dmitry Fleytman Upon processing of VIRTIO_NET_CTRL_MAC_TABLE_SET command multicast list overwrites unicast list in mac_table. This leads to broken logic for both unicast and multicast RX filtering. Signed-off-by: Dmitry Fleytman --- 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 dd41008..e822ab1 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -656,7 +656,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.3.1