diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c --- a/sys/kern/kern_sendfile.c +++ b/sys/kern/kern_sendfile.c @@ -668,8 +668,6 @@ */ if ((*so)->so_proto->pr_protocol == IPPROTO_SCTP) return (EINVAL); - if (SOLISTENING(*so)) - return (ENOTCONN); return (0); } diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1352,10 +1352,6 @@ { int error; - /* XXXMJ racy */ - if (SOLISTENING(so)) - return (EOPNOTSUPP); - CURVNET_SET(so->so_vnet); /* * If protocol is connection-based, can only connect once. @@ -1841,14 +1837,8 @@ int error; CURVNET_SET(so->so_vnet); - if (!SOLISTENING(so)) - error = so->so_proto->pr_usrreqs->pru_sosend(so, addr, uio, - top, control, flags, td); - else { - m_freem(top); - m_freem(control); - error = ENOTCONN; - } + error = so->so_proto->pr_usrreqs->pru_sosend(so, addr, uio, + top, control, flags, td); CURVNET_RESTORE(); return (error); } @@ -2843,11 +2833,8 @@ int error; CURVNET_SET(so->so_vnet); - if (!SOLISTENING(so)) - error = (so->so_proto->pr_usrreqs->pru_soreceive(so, psa, uio, - mp0, controlp, flagsp)); - else - error = ENOTCONN; + error = (so->so_proto->pr_usrreqs->pru_soreceive(so, psa, uio, + mp0, controlp, flagsp)); CURVNET_RESTORE(); return (error); }