summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2018-12-16 17:46:58 +0000
committerchristos <christos@NetBSD.org>2018-12-16 17:46:58 +0000
commit65093efef762d730bf3f84c6bdf79dcf2f7f0cb2 (patch)
tree4d00059c846fb4ae0d472b4dd920e78973f40715 /sys/netinet
parent7f9882455050f075df8b1c111c72ccc23f9280a8 (diff)
sbspace() does not return negative values anymore and that broke OOB data
sending. Instead of depending on negative values, account for the 1024 bytes sosend() adds so that it can use all the space here in a separate function sbspace_oob(). Idea from mlelstv@
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/dccp_usrreq.c6
-rw-r--r--sys/netinet/tcp_usrreq.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet/dccp_usrreq.c b/sys/netinet/dccp_usrreq.c
index 3fd29ad5c5a..fe32333553e 100644
--- a/sys/netinet/dccp_usrreq.c
+++ b/sys/netinet/dccp_usrreq.c
@@ -1,5 +1,5 @@
/* $KAME: dccp_usrreq.c,v 1.67 2005/11/03 16:05:04 nishida Exp $ */
-/* $NetBSD: dccp_usrreq.c,v 1.20 2018/09/14 05:09:51 maxv Exp $ */
+/* $NetBSD: dccp_usrreq.c,v 1.21 2018/12/16 17:46:58 christos Exp $ */
/*
* Copyright (c) 2003 Joacim Häggmark, Magnus Erixzon, Nils-Erik Mattsson
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dccp_usrreq.c,v 1.20 2018/09/14 05:09:51 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dccp_usrreq.c,v 1.21 2018/12/16 17:46:58 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -2157,7 +2157,7 @@ dccp_send(struct socket *so, struct mbuf *m, struct sockaddr *addr,
}
}
- if (sbspace(&so->so_snd) < -512) {
+ if (sbspace_oob(&so->so_snd) == 0) {
INP_UNLOCK(inp);
error = ENOBUFS;
goto release;
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 1daecacdae6..a05dde41eb7 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_usrreq.c,v 1.221 2018/11/24 17:05:54 maxv Exp $ */
+/* $NetBSD: tcp_usrreq.c,v 1.222 2018/12/16 17:46:58 christos Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -99,7 +99,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.221 2018/11/24 17:05:54 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.222 2018/12/16 17:46:58 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -1154,7 +1154,7 @@ tcp_sendoob(struct socket *so, struct mbuf *m, struct mbuf *control)
ostate = tcp_debug_capture(tp, PRU_SENDOOB);
s = splsoftnet();
- if (sbspace(&so->so_snd) < -512) {
+ if (sbspace_oob(&so->so_snd) == 0) {
m_freem(m);
splx(s);
return ENOBUFS;