Commit b873a55c authored by Anthony Liguori's avatar Anthony Liguori
Browse files

Merge remote-tracking branch 'stefanha/net' into staging



# By Dmitry Fleytman (1) and others
# Via Stefan Hajnoczi
* stefanha/net:
  virtio-net: broken RX filtering logic fixed
  net: fix qemu_flush_queued_packets() in presence of a hub
  net: disallow to specify multicast MAC address

Message-id: 1383928804-28866-1-git-send-email-stefanha@redhat.com
Signed-off-by: default avatarAnthony Liguori <aliguori@amazon.com>
parents deb0f500 cc386e96
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
+3 −3
Original line number Diff line number Diff line
@@ -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 {
+6 −1
Original line number Diff line number Diff line
@@ -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"
@@ -442,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
@@ -689,6 +689,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) {