From: Dmitry Fleytman <dmitry@daynix.com>
To: qemu-devel@nongnu.org
Cc: Yan Vugenfirer <yan@daynix.com>,
Stefan Hajnoczi <stefanha@gmail.com>, Ronen Hod <rhod@redhat.com>,
Anthony Liguori <anthony@codemonkey.ws>
Subject: [Qemu-devel] [PATCH] virtio-net: broken RX filtering logic fixed
Date: Sun, 22 Sep 2013 18:09:13 +0300 [thread overview]
Message-ID: <1379862553-26307-1-git-send-email-dmitry@daynix.com> (raw)
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
next reply other threads:[~2013-09-22 15:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-22 15:09 Dmitry Fleytman [this message]
2013-09-23 13:05 ` [Qemu-devel] [PATCH] virtio-net: broken RX filtering logic fixed Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1379862553-26307-1-git-send-email-dmitry@daynix.com \
--to=dmitry@daynix.com \
--cc=anthony@codemonkey.ws \
--cc=qemu-devel@nongnu.org \
--cc=rhod@redhat.com \
--cc=stefanha@gmail.com \
--cc=yan@daynix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).