aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/sockbuf.h
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2018-08-04 20:26:54 +0000
committerMark Johnston <markj@FreeBSD.org>2018-08-04 20:26:54 +0000
commit5b0480f2cca0a4a04f21055ed769be93f11348de (patch)
tree6eda8a5f6d172310ef4f8fe29887172d77e6476e /sys/sys/sockbuf.h
parente62ca80bde61076b8b306140407ecf461c28b792 (diff)
downloadsrc-5b0480f2cca0a4a04f21055ed769be93f11348de.tar.gz
src-5b0480f2cca0a4a04f21055ed769be93f11348de.zip
Don't check rcv sockbuf limits when sending on a unix stream socket.
sosend_generic() performs an initial comparison of the amount of data (including control messages) to be transmitted with the send buffer size. When transmitting on a unix socket, we then compare the amount of data being sent with the amount of space in the receive buffer size; if insufficient space is available, sbappendcontrol() returns an error and the data is lost. This is easily triggered by sending control messages together with an amount of data roughly equal to the send buffer size, since the control message size may change in uipc_send() as file descriptors are internalized. Fix the problem by removing the space check in sbappendcontrol(), whose only consumer is the unix sockets code. The stream sockets code uses the SB_STOP mechanism to ensure that senders will block if the receive buffer fills up. PR: 181741 MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16515
Notes
Notes: svn path=/head/; revision=337328
Diffstat (limited to 'sys/sys/sockbuf.h')
-rw-r--r--sys/sys/sockbuf.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/sys/sockbuf.h b/sys/sys/sockbuf.h
index ff7863da6055..ad452ad4f4ab 100644
--- a/sys/sys/sockbuf.h
+++ b/sys/sys/sockbuf.h
@@ -139,9 +139,9 @@ int sbappendaddr_locked(struct sockbuf *sb, const struct sockaddr *asa,
struct mbuf *m0, struct mbuf *control);
int sbappendaddr_nospacecheck_locked(struct sockbuf *sb,
const struct sockaddr *asa, struct mbuf *m0, struct mbuf *control);
-int sbappendcontrol(struct sockbuf *sb, struct mbuf *m0,
+void sbappendcontrol(struct sockbuf *sb, struct mbuf *m0,
struct mbuf *control);
-int sbappendcontrol_locked(struct sockbuf *sb, struct mbuf *m0,
+void sbappendcontrol_locked(struct sockbuf *sb, struct mbuf *m0,
struct mbuf *control);
void sbappendrecord(struct sockbuf *sb, struct mbuf *m0);
void sbappendrecord_locked(struct sockbuf *sb, struct mbuf *m0);