]> git.proxmox.com Git - qemu.git/commitdiff
virtio-net: broken RX filtering logic fixed
authorDmitry Fleytman <dfleytma@redhat.com>
Sun, 22 Sep 2013 15:09:13 +0000 (18:09 +0300)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 8 Nov 2013 16:32:34 +0000 (17:32 +0100)
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 <dfleytma@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/net/virtio-net.c

index ae51d96a7aa0b1454aa3a9fc05831935fb7d73aa..613f144d12f3373f34301d3c05b5b772cb10fb6d 100644 (file)
@@ -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;