summary refs log tree commit diff stats
path: root/hw/net/virtio-net.c
diff options
context:
space:
mode:
authorDmitry Fleytman <dfleytma@redhat.com>2013-09-22 18:09:13 +0300
committerStefan Hajnoczi <stefanha@redhat.com>2013-11-08 17:32:34 +0100
commitcc386e96727442f5b67052d4e0a602f6f652ffe6 (patch)
tree206791fe0055f9dc59be2a6893fa1f674826e4a5 /hw/net/virtio-net.c
parent1597591cca8a8fa20b8872937b859ec2aaccba6c (diff)
downloadfocaccia-qemu-cc386e96727442f5b67052d4e0a602f6f652ffe6.tar.gz
focaccia-qemu-cc386e96727442f5b67052d4e0a602f6f652ffe6.zip
virtio-net: broken RX filtering logic fixed
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>
Diffstat (limited to 'hw/net/virtio-net.c')
-rw-r--r--hw/net/virtio-net.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index ae51d96a7a..613f144d12 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;