diff options
author | jlemon <jlemon@FreeBSD.org> | 2001-03-12 02:57:42 +0000 |
---|---|---|
committer | jlemon <jlemon@FreeBSD.org> | 2001-03-12 02:57:42 +0000 |
commit | 9b532c7054cf3ae570bbf4f36637b7a80564cee5 (patch) | |
tree | aa44a60cc9c7ea35809ad36cecf830c1ec2ecf4b /sys/netinet/tcp_usrreq.c | |
parent | 127c8b5683fd627b306f1828a5efb6ec01af6a66 (diff) | |
download | FreeBSD-src-9b532c7054cf3ae570bbf4f36637b7a80564cee5.zip FreeBSD-src-9b532c7054cf3ae570bbf4f36637b7a80564cee5.tar.gz |
Unbreak LINT.
Pointed out by: phk
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-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 2b76f98..ecd84a9 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); } |