提交 cc386e96 编写于 作者: D Dmitry Fleytman 提交者: Stefan Hajnoczi

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: NDmitry Fleytman <dfleytma@redhat.com>
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 1597591c
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册