qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL for-1.7 0/3] Net patches
@ 2013-11-08 16:40 Stefan Hajnoczi
  2013-11-08 16:40 ` [Qemu-devel] [PULL 1/3] net: disallow to specify multicast MAC address Stefan Hajnoczi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2013-11-08 16:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Anthony Liguori

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

-- 
1.8.3.1

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

* [Qemu-devel] [PULL 1/3] net: disallow to specify multicast MAC address
  2013-11-08 16:40 [Qemu-devel] [PULL for-1.7 0/3] Net patches Stefan Hajnoczi
@ 2013-11-08 16:40 ` Stefan Hajnoczi
  2013-11-08 16:40 ` [Qemu-devel] [PULL 2/3] net: fix qemu_flush_queued_packets() in presence of a hub Stefan Hajnoczi
  2013-11-08 16:40 ` [Qemu-devel] [PULL 3/3] virtio-net: broken RX filtering logic fixed Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2013-11-08 16:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi, Dmitry Krivenok, Anthony Liguori

From: Dmitry Krivenok <krivenok.dmitry@gmail.com>

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

Signed-off-by: Dmitry V. Krivenok <krivenok.dmitry@gmail.com>
Reviewed-by: Amos Kong <kongjianjun@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 include/net/eth.h | 6 +++---
 net/net.c         | 6 ++++++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/net/eth.h b/include/net/eth.h
index 1d48e06..b3273b8 100644
--- a/include/net/eth.h
+++ b/include/net/eth.h
@@ -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 {
diff --git a/net/net.c b/net/net.c
index c330c9a..870d3bb 100644
--- a/net/net.c
+++ b/net/net.c
@@ -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) {
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 2/3] net: fix qemu_flush_queued_packets() in presence of a hub
  2013-11-08 16:40 [Qemu-devel] [PULL for-1.7 0/3] Net patches Stefan Hajnoczi
  2013-11-08 16:40 ` [Qemu-devel] [PULL 1/3] net: disallow to specify multicast MAC address Stefan Hajnoczi
@ 2013-11-08 16:40 ` Stefan Hajnoczi
  2013-11-08 16:40 ` [Qemu-devel] [PULL 3/3] virtio-net: broken RX filtering logic fixed Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2013-11-08 16:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Sergey Fedorov, Stefan Hajnoczi, Anthony Liguori

From: Sergey Fedorov <s.fedorov@samsung.com>

Do not return after net_hub_flush(). Always flush callee network client
incoming queue.

Signed-off-by: Sergey Fedorov <s.fedorov@samsung.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 net/net.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/net.c b/net/net.c
index 870d3bb..0a88e68 100644
--- a/net/net.c
+++ b/net/net.c
@@ -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
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 3/3] virtio-net: broken RX filtering logic fixed
  2013-11-08 16:40 [Qemu-devel] [PULL for-1.7 0/3] Net patches Stefan Hajnoczi
  2013-11-08 16:40 ` [Qemu-devel] [PULL 1/3] net: disallow to specify multicast MAC address Stefan Hajnoczi
  2013-11-08 16:40 ` [Qemu-devel] [PULL 2/3] net: fix qemu_flush_queued_packets() in presence of a hub Stefan Hajnoczi
@ 2013-11-08 16:40 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2013-11-08 16:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Dmitry Fleytman, Stefan Hajnoczi, 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>
Signed-off-by: Stefan Hajnoczi <stefanha@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 ae51d96..613f144 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;
-- 
1.8.3.1

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

end of thread, other threads:[~2013-11-08 16:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-08 16:40 [Qemu-devel] [PULL for-1.7 0/3] Net patches Stefan Hajnoczi
2013-11-08 16:40 ` [Qemu-devel] [PULL 1/3] net: disallow to specify multicast MAC address Stefan Hajnoczi
2013-11-08 16:40 ` [Qemu-devel] [PULL 2/3] net: fix qemu_flush_queued_packets() in presence of a hub Stefan Hajnoczi
2013-11-08 16:40 ` [Qemu-devel] [PULL 3/3] virtio-net: broken RX filtering logic fixed 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).