Page MenuHomeFreeBSD

D43415.diff
No OneTemporary

D43415.diff

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
@@ -95,9 +95,9 @@
*
* NOTE: With regard to VNETs the general rule is that callers do not set
* curvnet. Exceptions to this rule include soabort(), sodisconnect(),
- * sofree() (and with that sorele(), sotryfree()), as well as sonewconn()
- * and sorflush(), which are usually called from a pre-set VNET context.
- * sopoll() currently does not need a VNET context to be set.
+ * sofree() (and with that sorele(), sotryfree()), as well as sonewconn(),
+ * which are usually called from a pre-set VNET context. sopoll() currently
+ * does not need a VNET context to be set.
*/
#include <sys/cdefs.h>
@@ -2971,36 +2971,6 @@
return (error);
}
-/*
- * Used by several pr_shutdown implementations that use generic socket buffers.
- */
-void
-sorflush(struct socket *so)
-{
- int error;
-
- VNET_SO_ASSERT(so);
-
- /*
- * Dislodge threads currently blocked in receive and wait to acquire
- * a lock against other simultaneous readers before clearing the
- * socket buffer. Don't let our acquire be interrupted by a signal
- * despite any existing socket disposition on interruptable waiting.
- */
- socantrcvmore(so);
-
- error = SOCK_IO_RECV_LOCK(so, SBL_WAIT | SBL_NOINTR);
- if (error != 0) {
- KASSERT(SOLISTENING(so),
- ("%s: soiolock(%p) failed", __func__, so));
- return;
- }
-
- sbrelease(so, SO_RCV);
- SOCK_IO_RECV_UNLOCK(so);
-
-}
-
/*
* Wrapper for Socket established helper hook.
* Parameters: socket, context of the hook point, hook id.
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -457,10 +457,12 @@
*/
switch (how) {
case SHUT_RD:
- sorflush(so);
+ socantrcvmore(so);
+ sbrelease(so, SO_RCV);
break;
case SHUT_RDWR:
- sorflush(so);
+ socantrcvmore(so);
+ sbrelease(so, SO_RCV);
/* FALLTHROUGH */
case SHUT_WR:
socantsendmore(so);
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -994,10 +994,12 @@
switch (how) {
case SHUT_RD:
- sorflush(so);
+ socantrcvmore(so);
+ sbrelease(so, SO_RCV);
break;
case SHUT_RDWR:
- sorflush(so);
+ socantrcvmore(so);
+ sbrelease(so, SO_RCV);
/* FALLTHROUGH */
case SHUT_WR:
socantsendmore(so);
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c
--- a/sys/netinet/sctp_usrreq.c
+++ b/sys/netinet/sctp_usrreq.c
@@ -868,11 +868,7 @@
SCTP_TCB_UNLOCK(stcb);
}
SCTP_INP_WUNLOCK(inp);
- /*
- * XXXGL: does SCTP need sorflush()? This is what old
- * soshutdown() used to do for all kinds of sockets.
- */
- sorflush(so);
+ socantrcvmore(so);
if (how == SHUT_RD)
break;
/* FALLTHROUGH */
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -824,10 +824,12 @@
switch (how) {
case SHUT_RD:
- sorflush(so);
+ socantrcvmore(so);
+ sbrelease(so, SO_RCV);
break;
case SHUT_RDWR:
- sorflush(so);
+ socantrcvmore(so);
+ sbrelease(so, SO_RCV);
/* FALLTHROUGH */
case SHUT_WR:
/*
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1696,10 +1696,12 @@
switch (how) {
case SHUT_RD:
- sorflush(so);
+ socantrcvmore(so);
+ sbrelease(so, SO_RCV);
break;
case SHUT_RDWR:
- sorflush(so);
+ socantrcvmore(so);
+ sbrelease(so, SO_RCV);
/* FALLTHROUGH */
case SHUT_WR:
socantsendmore(so);
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -839,10 +839,12 @@
switch (how) {
case SHUT_RD:
- sorflush(so);
+ socantrcvmore(so);
+ sbrelease(so, SO_RCV);
break;
case SHUT_RDWR:
- sorflush(so);
+ socantrcvmore(so);
+ sbrelease(so, SO_RCV);
/* FALLTHROUGH */
case SHUT_WR:
socantsendmore(so);
diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h
--- a/sys/sys/socketvar.h
+++ b/sys/sys/socketvar.h
@@ -501,7 +501,6 @@
void sorele_locked(struct socket *so);
void sodealloc(struct socket *);
int soreserve(struct socket *so, u_long sndcc, u_long rcvcc);
-void sorflush(struct socket *so);
int sosend(struct socket *so, struct sockaddr *addr, struct uio *uio,
struct mbuf *top, struct mbuf *control, int flags,
struct thread *td);

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 2:50 AM (21 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14688825
Default Alt Text
D43415.diff (4 KB)

Event Timeline