From: bluhm Date: Tue, 23 Jan 2018 20:49:58 +0000 (+0000) Subject: Bring back the PRU_ATTACH constant and description. Then trpt(8) X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5b4b4f44843050d177c9bc25fa664c114557c8f5;p=openbsd Bring back the PRU_ATTACH constant and description. Then trpt(8) prints the ATTACH action for TCP debugging socketes correctly. OK bluhm@ --- diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index c534f0eb2b7..4c33de84279 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_usrreq.c,v 1.164 2018/01/22 20:27:28 bluhm Exp $ */ +/* $OpenBSD: tcp_usrreq.c,v 1.165 2018/01/23 20:49:58 bluhm Exp $ */ /* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */ /* @@ -602,8 +602,8 @@ tcp_attach(struct socket *so, int proto) if ((so->so_options & SO_LINGER) && so->so_linger == 0) so->so_linger = TCP_LINGERTIME; - if (tp && (so->so_options & SO_DEBUG)) - tcp_trace(TA_USER, 0, tp, (caddr_t)0, 0 /* XXX */, 0); + if (so->so_options & SO_DEBUG) + tcp_trace(TA_USER, TCPS_CLOSED, tp, (caddr_t)0, PRU_ATTACH, 0); return (0); } diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h index 4bd22c85573..995a038a47d 100644 --- a/sys/sys/protosw.h +++ b/sys/sys/protosw.h @@ -1,4 +1,4 @@ -/* $OpenBSD: protosw.h,v 1.30 2018/01/23 20:41:42 bluhm Exp $ */ +/* $OpenBSD: protosw.h,v 1.31 2018/01/23 20:49:58 bluhm Exp $ */ /* $NetBSD: protosw.h,v 1.10 1996/04/09 20:55:32 cgd Exp $ */ /*- @@ -121,6 +121,7 @@ struct protosw { * A non-zero return from usrreq gives an * UNIX error number which should be passed to higher level software. */ +#define PRU_ATTACH 0 /* attach protocol to up */ #define PRU_DETACH 1 /* detach protocol from up */ #define PRU_BIND 2 /* bind socket to address */ #define PRU_LISTEN 3 /* listen for connection */ @@ -148,7 +149,7 @@ struct protosw { #ifdef PRUREQUESTS const char *prurequests[] = { - "", "DETACH", "BIND", "LISTEN", + "ATTACH", "DETACH", "BIND", "LISTEN", "CONNECT", "ACCEPT", "DISCONNECT", "SHUTDOWN", "RCVD", "SEND", "ABORT", "CONTROL", "SENSE", "RCVOOB", "SENDOOB", "SOCKADDR",