git: 1d8c5f8e0255 - main - sendfile: Fix build for kernels without INET or INET6
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 06 Oct 2026 02:45:36 UTC
The branch main has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=1d8c5f8e02558faa578329eb9e2076e04de3fc5d
commit 1d8c5f8e02558faa578329eb9e2076e04de3fc5d
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2026-10-05 21:00:56 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-10-06 02:35:15 +0000
sendfile: Fix build for kernels without INET or INET6
Don't cap the new low watermark to a TCP-specific setting in kernels
without TCP.
Fixes: 6948f4d5e2b2 ("sendfile: keep the lowat hack more conservative")
---
sys/kern/kern_sendfile.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c
index a14b88b2169e..b9e7a1a2ce97 100644
--- a/sys/kern/kern_sendfile.c
+++ b/sys/kern/kern_sendfile.c
@@ -660,7 +660,11 @@ sendfile_wait_generic(struct socket *so, off_t need, int *space)
SOCK_SENDBUF_LOCK(so);
lowat = so->so_snd.sb_lowat;
if (so->so_snd.sb_flags & SB_AUTOLOWAT) {
+#if defined(INET) || defined(INET6)
newlowat = min(V_tcp_sendspace, so->so_snd.sb_hiwat) / 2;
+#else
+ newlowat = so->so_snd.sb_hiwat / 2;
+#endif
if (so->so_snd.sb_lowat < newlowat)
so->so_snd.sb_lowat = newlowat;
if (so->so_snd.sb_lowat < PAGE_SIZE &&