mirror_qemu/net
Daniel P. Berrange 95a0638043 net: fix sending of data with -net socket, listen backend
The use of -net socket,listen was broken in the following
commit

  commit 16a3df403b
  Author: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
  Date:   Fri May 13 15:35:19 2016 +0800

    net/net: Add SocketReadState for reuse codes

    This function is from net/socket.c, move it to net.c and net.h.
    Add SocketReadState to make others reuse net_fill_rstate().
    suggestion from jason.

This refactored the state out of NetSocketState into a
separate SocketReadState. This refactoring requires
that a callback is provided to be triggered upon
completion of a packet receive from the guest.

The patch only registered this callback in the codepaths
hit by -net socket,connect, not -net socket,listen. So
as a result packets sent by the guest in the latter case
get dropped on the floor.

This bug is hidden because net_fill_rstate() silently
does nothing if the callback is not set.

This patch adds in the middle callback registration
and also adds an assert so that QEMU aborts if there
are any other codepaths hit which are missing the
callback.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit e79cd40680)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2016-11-18 19:06:19 -06:00
..
Makefile.objs net/filter-mirror:Add filter-mirror 2016-03-30 08:54:29 +08:00
checksum.c net: handle optional VLAN header in checksum computation. 2016-06-02 10:42:46 +08:00
clients.h net: use Netdev instead of NetClientOptions in client init 2016-07-19 13:21:08 +02:00
dump.c qapi: Change Netdev into a flat union 2016-07-19 20:18:02 +02:00
eth.c net: fix incorrect argument to iov_to_buf 2016-07-18 16:16:52 +08:00
filter-buffer.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
filter-mirror.c net/net: Add SocketReadState for reuse codes 2016-06-01 09:25:29 +08:00
filter.c qapi: Change Netdev into a flat union 2016-07-19 20:18:02 +02:00
hub.c qapi: Change Netdev into a flat union 2016-07-19 20:18:02 +02:00
hub.h net: fix qemu_flush_queued_packets() in presence of a hub 2013-02-27 16:10:23 +01:00
l2tpv3.c qapi: Change Netdev into a flat union 2016-07-19 20:18:02 +02:00
net.c net: fix sending of data with -net socket, listen backend 2016-11-18 19:06:19 -06:00
netmap.c qapi: Change Netdev into a flat union 2016-07-19 20:18:02 +02:00
queue.c net: Clean up includes 2016-02-04 17:41:30 +00:00
slirp.c slirp: fix segv when init failed 2016-08-22 15:20:32 +08:00
socket.c net: fix sending of data with -net socket, listen backend 2016-11-18 19:06:19 -06:00
tap-aix.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
tap-bsd.c util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00
tap-haiku.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
tap-linux.c util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00
tap-linux.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
tap-solaris.c util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00
tap-win32.c qapi: Change Netdev into a flat union 2016-07-19 20:18:02 +02:00
tap.c vhost-user: keep vhost_net after a disconnection 2016-07-29 00:33:48 +03:00
tap_int.h Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
trace-events trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
util.c net: Clean up includes 2016-02-04 17:41:30 +00:00
util.h all: Clean up includes 2016-02-23 12:43:05 +00:00
vde.c qapi: Change Netdev into a flat union 2016-07-19 20:18:02 +02:00
vhost-user.c vhost-user: wait until backend init is completed 2016-07-29 00:33:49 +03:00