aboutsummaryrefslogtreecommitdiff
path: root/socket.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2013-02-22 20:47:10 +0100
committerJan Kiszka <jan.kiszka@siemens.com>2013-02-26 12:10:21 +0100
commit8b3706dae059856a1c6f1914f76ad35e602fa6f4 (patch)
tree94edfefc0a6aded39593d272b15020cac2df9cef /socket.c
parentfc7626711be9b339157e48f29e54c64f612171cb (diff)
downloadslirp-8b3706dae059856a1c6f1914f76ad35e602fa6f4.zip
slirp-8b3706dae059856a1c6f1914f76ad35e602fa6f4.tar.gz
slirp-8b3706dae059856a1c6f1914f76ad35e602fa6f4.tar.bz2
slirp: Properly initialize pollfds_idx of new sockets
Otherwise we may start processing sockets in slirp_pollfds_poll that were created past slirp_pollfds_fill. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/socket.c b/socket.c
index 9f7c1a6..8786c6f 100644
--- a/socket.c
+++ b/socket.c
@@ -46,6 +46,7 @@ struct socket *socreate(Slirp *slirp)
so->so_state = SS_NOFDREF;
so->s = -1;
so->slirp = slirp;
+ so->pollfds_idx = -1;
}
return (so);
}