Loading slirp/tcp_subr.c +72 −68 Original line number Diff line number Diff line Loading @@ -384,8 +384,7 @@ int tcp_fconnect(struct socket *so) * the time it gets to accept(), so... We simply accept * here and SYN the local-host. */ void tcp_connect(struct socket *inso) void tcp_connect(struct socket *inso) { Slirp *slirp = inso->slirp; struct socket *so; Loading @@ -405,7 +404,8 @@ tcp_connect(struct socket *inso) /* FACCEPTONCE already have a tcpcb */ so = inso; } else { if ((so = socreate(slirp)) == NULL) { so = socreate(slirp); if (so == NULL) { /* If it failed, get rid of the pending connection */ closesocket(accept(inso->s, (struct sockaddr *)&addr, &addrlen)); return; Loading @@ -418,9 +418,10 @@ tcp_connect(struct socket *inso) so->so_lport = inso->so_lport; } (void) tcp_mss(sototcpcb(so), 0); tcp_mss(sototcpcb(so), 0); if ((s = accept(inso->s,(struct sockaddr *)&addr,&addrlen)) < 0) { s = accept(inso->s, (struct sockaddr *)&addr, &addrlen); if (s < 0) { tcp_close(sototcpcb(so)); /* This will sofree() as well */ return; } Loading @@ -443,9 +444,12 @@ tcp_connect(struct socket *inso) /* Close the accept() socket, set right state */ if (inso->so_state & SS_FACCEPTONCE) { closesocket(so->s); /* If we only accept once, close the accept() socket */ so->so_state = SS_NOFDREF; /* Don't select it yet, even though we have an FD */ /* If we only accept once, close the accept() socket */ closesocket(so->s); /* Don't select it yet, even though we have an FD */ /* if it's not FACCEPTONCE, it's already NOFDREF */ so->so_state = SS_NOFDREF; } so->s = s; so->so_state |= SS_INCOMING; Loading Loading
slirp/tcp_subr.c +72 −68 Original line number Diff line number Diff line Loading @@ -384,8 +384,7 @@ int tcp_fconnect(struct socket *so) * the time it gets to accept(), so... We simply accept * here and SYN the local-host. */ void tcp_connect(struct socket *inso) void tcp_connect(struct socket *inso) { Slirp *slirp = inso->slirp; struct socket *so; Loading @@ -405,7 +404,8 @@ tcp_connect(struct socket *inso) /* FACCEPTONCE already have a tcpcb */ so = inso; } else { if ((so = socreate(slirp)) == NULL) { so = socreate(slirp); if (so == NULL) { /* If it failed, get rid of the pending connection */ closesocket(accept(inso->s, (struct sockaddr *)&addr, &addrlen)); return; Loading @@ -418,9 +418,10 @@ tcp_connect(struct socket *inso) so->so_lport = inso->so_lport; } (void) tcp_mss(sototcpcb(so), 0); tcp_mss(sototcpcb(so), 0); if ((s = accept(inso->s,(struct sockaddr *)&addr,&addrlen)) < 0) { s = accept(inso->s, (struct sockaddr *)&addr, &addrlen); if (s < 0) { tcp_close(sototcpcb(so)); /* This will sofree() as well */ return; } Loading @@ -443,9 +444,12 @@ tcp_connect(struct socket *inso) /* Close the accept() socket, set right state */ if (inso->so_state & SS_FACCEPTONCE) { closesocket(so->s); /* If we only accept once, close the accept() socket */ so->so_state = SS_NOFDREF; /* Don't select it yet, even though we have an FD */ /* If we only accept once, close the accept() socket */ closesocket(so->s); /* Don't select it yet, even though we have an FD */ /* if it's not FACCEPTONCE, it's already NOFDREF */ so->so_state = SS_NOFDREF; } so->s = s; so->so_state |= SS_INCOMING; Loading