Net patches
[Qemu-devel] [PULL 2/3] net: fix qemu_flush_queued_packets() in presence of a hub
In reply to Stefan HajnocziFrom: Sergey Fedorov <[email protected]>
Do not return after net_hub_flush(). Always flush callee network client incoming queue.
--- net/net.c | 1 - 1 file changed, 1 deletion(-)
net/net.c +0 -1
@@ -443,7 +443,6 @@ void qemu_flush_queued_packets(NetClientState *nc)if (net_hub_flush (nc->peer)) {qemu_notify_event (); } -return ; }if (qemu_net_queue_flush (nc->incoming_queue)) {/* We emptied the queue successfully, signal to the IO thread to repoll
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 3/3] virtio-net: broken RX filtering logic fixed
In reply to Stefan HajnocziFrom: Dmitry Fleytman <[email protected]>
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.
--- hw/net/virtio-net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
hw/net/virtio-net.c +2 -1
@@ -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;
Signature · 1 line
1.8.3.1
Bug fixes for QEMU 1.7.
The following changes since commit 964668b03d26f0b5baa5e5aff0c966f4fcb76e9e:
Update version for 1.7.0-rc0 release (2013-11-06 21:49:39 -0800)
are available in the git repository at:
git://github.com/stefanha/qemu.git net
for you to fetch changes up to cc386e96727442f5b67052d4e0a602f6f652ffe6:
virtio-net: broken RX filtering logic fixed (2013-11-08 17:32:34 +0100)
----------------------------------------------------------------
Dmitry Fleytman (1):
virtio-net: broken RX filtering logic fixed
Dmitry Krivenok (1):
net: disallow to specify multicast MAC address
Sergey Fedorov (1):
net: fix qemu_flush_queued_packets() in presence of a hub
hw/net/virtio-net.c | 3 ++- include/net/eth.h | 6 +++--- net/net.c | 7 ++++++- 3 files changed, 11 insertions(+), 5 deletions(-)
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 1/3] net: disallow to specify multicast MAC address
From: Dmitry Krivenok <[email protected]>
[Assigning a multicast MAC address to a NIC leads to confusing behavior. Reject multicast MAC addresses so users are alerted to their error straight away.
The "net/eth.h" in6_addr rename prevents a name collision with <netinet/in.h> on Linux.
-- Stefan]
--- include/net/eth.h | 6 +++--- net/net.c | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-)
include/net/eth.h +3 -3
@@ -84,7 +84,7 @@ typedef struct ip_pseudo_header { } ip_pseudo_header;/* IPv6 address */ -struct in6_addr { +struct in6_address {union {uint8_t __u6_addr8[16 ]; } __in6_u;
@@ -105,8 +105,8 @@ struct ip6_header {uint8_t ip6_un3_ecn;/* 2 bits ECN, top 6 bits payload length */ } ip6_un3; } ip6_ctlun; -struct in6_addr ip6_src;/* source address */ -struct in6_addr ip6_dst;/* destination address */ +struct in6_address ip6_src;/* source address */ +struct in6_address ip6_dst;/* destination address */ };struct ip6_ext_hdr {
net/net.c +6 -0
@@ -27,6 +27,7 @@#include "clients.h" #include "hub.h" #include "net/slirp.h" +#include "net/eth.h" #include "util.h" #include "monitor/monitor.h"
@@ -689,6 +690,11 @@ static int net_init_nic(const NetClientOptions *opts, const char *name,error_report ("invalid syntax for ethernet address" );return -1 ; } +if (nic->has_macaddr && +is_multicast_ether_addr (nd->macaddr.a)) { +error_report ("NIC cannot have multicast MAC address (odd 1st byte)" ); +return -1 ; + }qemu_macaddr_default_if_unset (&nd->macaddr);if (nic->has_vectors) {
Signature · 1 line
1.8.3.1