SCCS-vsn: sys/netinet/tcp_usrreq.c 6.3
-/* tcp_usrreq.c 6.2 84/08/21 */
+/* tcp_usrreq.c 6.3 84/08/28 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
error = soreserve(so, tcp_sendspace, tcp_recvspace);
if (error)
error = soreserve(so, tcp_sendspace, tcp_recvspace);
if (error)
error = in_pcballoc(so, &tcb);
if (error)
error = in_pcballoc(so, &tcb);
if (error)
inp = sotoinpcb(so);
tp = tcp_newtcpcb(inp);
if (tp == 0) {
inp = sotoinpcb(so);
tp = tcp_newtcpcb(inp);
if (tp == 0) {
- error = ENOBUFS;
- goto bad2;
+ int nofd = so->so_state & SS_NOFDREF; /* XXX */
+
+ so->so_state &= ~SS_NOFDREF; /* don't free the socket yet */
+ in_pcbdetach(inp);
+ so->so_state |= nofd;
+ return (ENOBUFS);
}
tp->t_state = TCPS_CLOSED;
return (0);
}
tp->t_state = TCPS_CLOSED;
return (0);
-bad2:
- in_pcbdetach(inp);
-bad:
- return (error);