aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-03-12 16:45:25 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-03-12 16:45:25 +0000
commit2f23e9ae2cc37788ae1211803a7f8545ae14df91 (patch)
tree72a512f9f2962dacf91f7411dfadf4de706868fc /net
parenta822837d123183293f1cfc3167cc4e5255765915 (diff)
parent68e5ec64009812dbaa03ed9cfded9344986f5304 (diff)
Merge remote-tracking branch 'remotes/stefanha/tags/net-pull-request' into staging
Net patches # gpg: Signature made Wed 12 Mar 2014 13:48:20 GMT using RSA key ID 81AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/net-pull-request: tap: avoid deadlocking rx Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'net')
-rw-r--r--net/tap.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/tap.c b/net/tap.c
index 2d5099b9be..8847ce100a 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -190,7 +190,7 @@ static void tap_send(void *opaque)
TAPState *s = opaque;
int size;
- do {
+ while (qemu_can_send_packet(&s->nc)) {
uint8_t *buf = s->buf;
size = tap_read_packet(s->fd, s->buf, sizeof(s->buf));
@@ -206,8 +206,11 @@ static void tap_send(void *opaque)
size = qemu_send_packet_async(&s->nc, buf, size, tap_send_completed);
if (size == 0) {
tap_read_poll(s, false);
+ break;
+ } else if (size < 0) {
+ break;
}
- } while (size > 0 && qemu_can_send_packet(&s->nc));
+ }
}
static bool tap_has_ufo(NetClientState *nc)