summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorSeokYeon Hwang <syeon.hwang@samsung.com>2013-09-10 12:18:05 +0900
committerSeokYeon Hwang <syeon.hwang@samsung.com>2013-09-10 12:18:05 +0900
commit74ba0a08e4265c04556102cda35743f0f09df318 (patch)
tree1331a947c908a50877632c2d9b916c664267540b /net
parentacdb0d70ee52e7e811665784af6c7bb22d4d613f (diff)
parent1ee2daeb6448312d6d0e22175f5c1b9b01f8974c (diff)
downloadqemu-74ba0a08e4265c04556102cda35743f0f09df318.tar.gz
qemu-74ba0a08e4265c04556102cda35743f0f09df318.tar.bz2
qemu-74ba0a08e4265c04556102cda35743f0f09df318.zip
Merge tag 'v1.6.0' into tizen_qemu_1.6
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com> Conflicts: VERSION arch_init.c block/vmdk.c configure cpu-exec.c cpus.c exec.c hw/9pfs/virtio-9p-device.c hw/display/vga-pci.c hw/pci-host/q35.c hw/usb/dev-storage.c hw/virtio/virtio-mmio.c include/exec/cpu-defs.h include/qemu/error-report.h include/qemu/log.h include/sysemu/kvm.h include/sysemu/sysemu.h pc-bios/bios.bin qapi-schema.json qemu-char.c ui/input.c util/oslib-win32.c vl.c
Diffstat (limited to 'net')
-rw-r--r--net/eth.c2
-rw-r--r--net/net.c48
-rw-r--r--net/slirp.c12
-rw-r--r--net/tap-bsd.c3
4 files changed, 57 insertions, 8 deletions
diff --git a/net/eth.c b/net/eth.c
index 1d7494d5e5..7c61132cbb 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -73,7 +73,7 @@ eth_get_gso_type(uint16_t l3_proto, uint8_t *l3_hdr, uint8_t l4proto)
}
/* Unsupported offload */
- assert(false);
+ g_assert_not_reached();
return VIRTIO_NET_HDR_GSO_NONE | ecn_state;
}
diff --git a/net/net.c b/net/net.c
index 43a74e43ae..c0d61bf78b 100644
--- a/net/net.c
+++ b/net/net.c
@@ -961,6 +961,54 @@ void print_net_client(Monitor *mon, NetClientState *nc)
nc->info_str);
}
+RxFilterInfoList *qmp_query_rx_filter(bool has_name, const char *name,
+ Error **errp)
+{
+ NetClientState *nc;
+ RxFilterInfoList *filter_list = NULL, *last_entry = NULL;
+
+ QTAILQ_FOREACH(nc, &net_clients, next) {
+ RxFilterInfoList *entry;
+ RxFilterInfo *info;
+
+ if (has_name && strcmp(nc->name, name) != 0) {
+ continue;
+ }
+
+ /* only query rx-filter information of NIC */
+ if (nc->info->type != NET_CLIENT_OPTIONS_KIND_NIC) {
+ if (has_name) {
+ error_setg(errp, "net client(%s) isn't a NIC", name);
+ break;
+ }
+ continue;
+ }
+
+ if (nc->info->query_rx_filter) {
+ info = nc->info->query_rx_filter(nc);
+ entry = g_malloc0(sizeof(*entry));
+ entry->value = info;
+
+ if (!filter_list) {
+ filter_list = entry;
+ } else {
+ last_entry->next = entry;
+ }
+ last_entry = entry;
+ } else if (has_name) {
+ error_setg(errp, "net client(%s) doesn't support"
+ " rx-filter querying", name);
+ break;
+ }
+ }
+
+ if (filter_list == NULL && !error_is_set(errp) && has_name) {
+ error_setg(errp, "invalid net client name: %s", name);
+ }
+
+ return filter_list;
+}
+
void do_info_network(Monitor *mon, const QDict *qdict)
{
NetClientState *nc, *peer;
diff --git a/net/slirp.c b/net/slirp.c
index b3f35d5861..124e953d9c 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -212,19 +212,19 @@ static int net_slirp_init(NetClientState *peer, const char *model,
return -1;
}
- if (vdhcp_start && !inet_aton(vdhcp_start, &dhcp)) {
+ if (vnameserver && !inet_aton(vnameserver, &dns)) {
return -1;
}
- if ((dhcp.s_addr & mask.s_addr) != net.s_addr ||
- dhcp.s_addr == host.s_addr || dhcp.s_addr == dns.s_addr) {
+ if ((dns.s_addr & mask.s_addr) != net.s_addr ||
+ dns.s_addr == host.s_addr) {
return -1;
}
- if (vnameserver && !inet_aton(vnameserver, &dns)) {
+ if (vdhcp_start && !inet_aton(vdhcp_start, &dhcp)) {
return -1;
}
- if ((dns.s_addr & mask.s_addr) != net.s_addr ||
- dns.s_addr == host.s_addr) {
+ if ((dhcp.s_addr & mask.s_addr) != net.s_addr ||
+ dhcp.s_addr == host.s_addr || dhcp.s_addr == dns.s_addr) {
return -1;
}
diff --git a/net/tap-bsd.c b/net/tap-bsd.c
index bcdb2682b5..f61d580963 100644
--- a/net/tap-bsd.c
+++ b/net/tap-bsd.c
@@ -44,7 +44,8 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
struct stat s;
#endif
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
+ defined(__OpenBSD__) || defined(__APPLE__)
/* if no ifname is given, always start the search from tap0/tun0. */
int i;
char dname[100];