diff options
author | 2018-01-22 20:27:28 +0000 | |
---|---|---|
committer | 2018-01-22 20:27:28 +0000 | |
commit | a89c8ae3a9bdf3183da941f35222ecbac0fc7ccf (patch) | |
tree | 076303137ade9acb8f852f126ff29fd888efe49a /sys/netinet/tcp_usrreq.c | |
parent | Triggered by Klemens Nanni patch, move OLD_WRKDIR_NAME into OBSOLETE VARIABLES (diff) | |
download | wireguard-openbsd-a89c8ae3a9bdf3183da941f35222ecbac0fc7ccf.tar.xz wireguard-openbsd-a89c8ae3a9bdf3183da941f35222ecbac0fc7ccf.zip |
Bring back the detach messages in trpt(8) for tcp debugging. They
got lost with the pr_detach conversion. While there, remove some
dead code.
OK mpi@
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index cc2b23e0661..c534f0eb2b7 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_usrreq.c,v 1.163 2018/01/09 15:14:23 mpi Exp $ */ +/* $OpenBSD: tcp_usrreq.c,v 1.164 2018/01/22 20:27:28 bluhm Exp $ */ /* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */ /* @@ -170,9 +170,8 @@ tcp_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam, if (inp) { tp = intotcpcb(inp); /* tp might get 0 when using socket splicing */ - if (tp == NULL) { + if (tp == NULL) return (0); - } #ifdef KPROF tcp_acounts[tp->t_state][req]++; #endif @@ -628,21 +627,16 @@ tcp_detach(struct socket *so) error = so->so_error; if (error == 0) error = EINVAL; - return (error); } - if (inp) { - tp = intotcpcb(inp); - /* tp might get 0 when using socket splicing */ - if (tp == NULL) { - return (0); - } + tp = intotcpcb(inp); + /* tp might get 0 when using socket splicing */ + if (tp == NULL) + return (0); #ifdef KPROF - tcp_acounts[tp->t_state][req]++; + tcp_acounts[tp->t_state][req]++; #endif - ostate = tp->t_state; - } else - ostate = 0; + ostate = tp->t_state; /* * Detach the TCP protocol from the socket. @@ -651,8 +645,10 @@ tcp_detach(struct socket *so) * which may finish later; embryonic TCB's can just * be discarded here. */ - tcp_disconnect(tp); + tp = tcp_disconnect(tp); + if (tp && (so->so_options & SO_DEBUG)) + tcp_trace(TA_USER, ostate, tp, (caddr_t)0, PRU_DETACH, 0); return (error); } |