diff --git a/share/man/man4/unix.4 b/share/man/man4/unix.4 --- a/share/man/man4/unix.4 +++ b/share/man/man4/unix.4 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 24, 2022 +.Dd February 1, 2022 .Dt UNIX 4 .Os .Sh NAME @@ -332,14 +332,6 @@ and .Dv LOCAL_CREDS_PERSISTENT options are mutually exclusive. -.It Dv LOCAL_CONNWAIT -Used with -.Dv SOCK_STREAM -sockets, this option causes the -.Xr connect 2 -function to block until -.Xr accept 2 -has been called on the listening socket. .It Dv LOCAL_PEERCRED Requested via .Xr getsockopt 2 diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -291,8 +291,7 @@ struct thread *); static int unp_connectat(int, struct socket *, struct sockaddr *, struct thread *, bool); -typedef enum { PRU_CONNECT, PRU_CONNECT2 } conn2_how; -static void unp_connect2(struct socket *so, struct socket *so2, conn2_how); +static void unp_connect2(struct socket *so, struct socket *so2); static void unp_disconnect(struct unpcb *unp, struct unpcb *unp2); static void unp_dispose(struct socket *so); static void unp_shutdown(struct unpcb *); @@ -704,7 +703,7 @@ unp2 = so2->so_pcb; KASSERT(unp2 != NULL, ("uipc_connect2: unp2 == NULL")); unp_pcb_lock_pair(unp, unp2); - unp_connect2(so1, so2, PRU_CONNECT2); + unp_connect2(so1, so2); unp_pcb_unlock_pair(unp, unp2); return (0); @@ -1784,12 +1783,6 @@ error = sooptcopyout(sopt, &optval, sizeof(optval)); break; - case LOCAL_CONNWAIT: - /* Unlocked read. */ - optval = unp->unp_flags & UNP_CONNWAIT ? 1 : 0; - error = sooptcopyout(sopt, &optval, sizeof(optval)); - break; - default: error = EOPNOTSUPP; break; @@ -1800,7 +1793,6 @@ switch (sopt->sopt_name) { case LOCAL_CREDS: case LOCAL_CREDS_PERSISTENT: - case LOCAL_CONNWAIT: error = sooptcopyin(sopt, &optval, sizeof(optval), sizeof(optval)); if (error) @@ -1829,10 +1821,6 @@ OPTSET(UNP_WANTCRED_ALWAYS, UNP_WANTCRED_ONESHOT); break; - case LOCAL_CONNWAIT: - OPTSET(UNP_CONNWAIT, 0); - break; - default: break; } @@ -2006,7 +1994,7 @@ KASSERT(unp2 != NULL && so2 != NULL && unp2->unp_socket == so2 && sotounpcb(so2) == unp2, ("%s: unp2 %p so2 %p", __func__, unp2, so2)); - unp_connect2(so, so2, PRU_CONNECT); + unp_connect2(so, so2); KASSERT((unp->unp_flags & UNP_CONNECTING) != 0, ("%s: unp %p has UNP_CONNECTING clear", __func__, unp)); unp->unp_flags &= ~UNP_CONNECTING; @@ -2057,7 +2045,7 @@ } static void -unp_connect2(struct socket *so, struct socket *so2, conn2_how req) +unp_connect2(struct socket *so, struct socket *so2) { struct unpcb *unp; struct unpcb *unp2; @@ -2089,11 +2077,7 @@ KASSERT(unp2->unp_conn == NULL, ("%s: socket %p is already connected", __func__, unp2)); unp2->unp_conn = unp; - if (req == PRU_CONNECT && - ((unp->unp_flags | unp2->unp_flags) & UNP_CONNWAIT)) - soisconnecting(so); - else - soisconnected(so); + soisconnected(so); soisconnected(so2); break; @@ -3491,10 +3475,6 @@ db_printf("%sUNP_WANTCRED_ONESHOT", comma ? ", " : ""); comma = 1; } - if (unp_flags & UNP_CONNWAIT) { - db_printf("%sUNP_CONNWAIT", comma ? ", " : ""); - comma = 1; - } if (unp_flags & UNP_CONNECTING) { db_printf("%sUNP_CONNECTING", comma ? ", " : ""); comma = 1; diff --git a/sys/sys/un.h b/sys/sys/un.h --- a/sys/sys/un.h +++ b/sys/sys/un.h @@ -65,7 +65,6 @@ #define LOCAL_PEERCRED 1 /* retrieve peer credentials */ #define LOCAL_CREDS 2 /* pass credentials to receiver */ #define LOCAL_CREDS_PERSISTENT 3 /* pass credentials to receiver */ -#define LOCAL_CONNWAIT 4 /* connects block until accepted */ /* Start of reserved space for third-party socket options. */ #define LOCAL_VENDOR SO_VENDOR diff --git a/sys/sys/unpcb.h b/sys/sys/unpcb.h --- a/sys/sys/unpcb.h +++ b/sys/sys/unpcb.h @@ -107,8 +107,6 @@ #define UNP_HAVEPC 0x001 #define UNP_WANTCRED_ALWAYS 0x002 /* credentials wanted always */ #define UNP_WANTCRED_ONESHOT 0x004 /* credentials wanted once */ -#define UNP_CONNWAIT 0x008 /* connect blocks until accepted */ - #define UNP_WANTCRED_MASK (UNP_WANTCRED_ONESHOT | UNP_WANTCRED_ALWAYS) /*