diff options
| author | Jonathan Lemon <jlemon@FreeBSD.org> | 2001-03-12 02:57:42 +0000 |
|---|---|---|
| committer | Jonathan Lemon <jlemon@FreeBSD.org> | 2001-03-12 02:57:42 +0000 |
| commit | 1db24ffb98a74acab6daaddc9445870f4a069dc9 (patch) | |
| tree | 539d208b8debade8b08e28523638bd92a72c8351 | |
| parent | da3badcd237dbb9cb4395c1cf7cabadc5c591daa (diff) | |
Notes
| -rw-r--r-- | sys/netinet/tcp_usrreq.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 2b76f982eaba..ecd84a92479e 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -101,7 +101,7 @@ static struct tcpcb * tcp_usrclosed __P((struct tcpcb *)); #ifdef TCPDEBUG -#define TCPDEBUG0 int ostate +#define TCPDEBUG0 int ostate = 0 #define TCPDEBUG1() ostate = tp ? tp->t_state : 0 #define TCPDEBUG2(req) if (tp && (so->so_options & SO_DEBUG)) \ tcp_trace(TA_USER, ostate, tp, 0, 0, req) @@ -417,13 +417,19 @@ tcp_usr_accept(struct socket *so, struct sockaddr **nam) int s = splnet(); int error = 0; struct inpcb *inp = sotoinpcb(so); - struct tcpcb *tp; + struct tcpcb *tp = NULL; + TCPDEBUG0; if (so->so_state & SS_ISDISCONNECTED) { error = ECONNABORTED; goto out; } - COMMON_START(); + if (inp == 0) { + splx(s); + return (EINVAL); + } + tp = intotcpcb(inp); + TCPDEBUG1(); in_setpeeraddr(so, nam); COMMON_END(PRU_ACCEPT); } @@ -435,13 +441,19 @@ tcp6_usr_accept(struct socket *so, struct sockaddr **nam) int s = splnet(); int error = 0; struct inpcb *inp = sotoinpcb(so); - struct tcpcb *tp; + struct tcpcb *tp = NULL; + TCPDEBUG0; if (so->so_state & SS_ISDISCONNECTED) { error = ECONNABORTED; goto out; } - COMMON_START(); + if (inp == 0) { + splx(s); + return (EINVAL); + } + tp = intotcpcb(inp); + TCPDEBUG1(); in6_mapped_peeraddr(so, nam); COMMON_END(PRU_ACCEPT); } |
