diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2026-10-05 21:00:56 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2026-10-06 02:35:15 +0000 |
| commit | 1d8c5f8e02558faa578329eb9e2076e04de3fc5d (patch) | |
| tree | a70f5e6cf85ff3651c5a1b1953bbf79a1150f079 | |
| parent | c907302c121acc5ed696544f86a6d44d07faf06c (diff) | |
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")
| -rw-r--r-- | sys/kern/kern_sendfile.c | 4 |
1 files changed, 4 insertions, 0 deletions
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 && |
