git: 7a06849669ac - stable/13 - unix: Increase the default datagram recv buffer size

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Fri, 31 Dec 2021 14:26:20 UTC
The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=7a06849669ac9fe936a89c908e464afbfbf85bf8

commit 7a06849669ac9fe936a89c908e464afbfbf85bf8
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-12-17 15:59:29 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-12-31 14:25:54 +0000

    unix: Increase the default datagram recv buffer size
    
    syslog(3) was recently change to support larger messages, up to 8KB.
    Our syslogd handles this fine, as it adjusts /dev/log's recv buffer to a
    large size.  rsyslog, however, uses the system default of 4KB.  This
    leads to problems since our syslog(3) retries indefinitely when a send()
    returns ENOBUFS, but if the message is large enough this will never
    succeed.
    
    Increase the default recv buffer size for datagram sockets to support
    8KB syslog messages without requiring the logging daemon to adjust its
    buffers.
    
    PR:             260126
    Reviewed by:    asomers
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit d157f2627b238ba38d1cad36f1aa165c42ce91ee)
---
 sys/kern/uipc_usrreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 35f2de7dbeb8..9c46e8588ed4 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -157,7 +157,7 @@ static struct task	unp_defer_task;
 static u_long	unpst_sendspace = PIPSIZ;
 static u_long	unpst_recvspace = PIPSIZ;
 static u_long	unpdg_sendspace = 2*1024;	/* really max datagram size */
-static u_long	unpdg_recvspace = 4*1024;
+static u_long	unpdg_recvspace = 16*1024;	/* support 8KB syslog msgs */
 static u_long	unpsp_sendspace = PIPSIZ;	/* really max datagram size */
 static u_long	unpsp_recvspace = PIPSIZ;