diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/net.c | 5 | ||||
-rw-r--r-- | net/socket.c | 1 |
2 files changed, 3 insertions, 3 deletions
@@ -1653,9 +1653,8 @@ int net_fill_rstate(SocketReadState *rs, const uint8_t *buf, int size) if (rs->index >= rs->packet_len) { rs->index = 0; rs->state = 0; - if (rs->finalize) { - rs->finalize(rs); - } + assert(rs->finalize); + rs->finalize(rs); } break; } diff --git a/net/socket.c b/net/socket.c index 982c8debe4..fe3547b018 100644 --- a/net/socket.c +++ b/net/socket.c @@ -511,6 +511,7 @@ static int net_socket_listen_init(NetClientState *peer, s->fd = -1; s->listen_fd = ret; s->nc.link_down = true; + net_socket_rs_init(&s->rs, net_socket_rs_finalize); qemu_set_fd_handler(s->listen_fd, net_socket_accept, NULL, s); qapi_free_SocketAddress(saddr); |