qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtio-net: broken RX filtering logic fixed
@ 2013-09-22 15:09 Dmitry Fleytman
  2013-09-23 13:05 ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Fleytman @ 2013-09-22 15:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Yan Vugenfirer, Stefan Hajnoczi, Ronen Hod, Anthony Liguori

From: Dmitry Fleytman <dfleytma@redhat.com>

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>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-net: broken RX filtering logic fixed
  2013-09-22 15:09 [Qemu-devel] [PATCH] virtio-net: broken RX filtering logic fixed Dmitry Fleytman
@ 2013-09-23 13:05 ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2013-09-23 13:05 UTC (permalink / raw)
  To: Dmitry Fleytman; +Cc: Yan Vugenfirer, Ronen Hod, qemu-devel, Anthony Liguori

On Sun, Sep 22, 2013 at 06:09:13PM +0300, Dmitry Fleytman wrote:
> From: Dmitry Fleytman <dfleytma@redhat.com>
> 
> 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>
> ---
>  hw/net/virtio-net.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Thanks, applied to my net-next tree:
https://github.com/stefanha/qemu/commits/net-next

Stefan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-23 13:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-22 15:09 [Qemu-devel] [PATCH] virtio-net: broken RX filtering logic fixed Dmitry Fleytman
2013-09-23 13:05 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).