#include <machine/limits.h>
+extern int tcp_sosnd_agglim;
+
#ifdef INET
static int do_setopt_accept_filter(struct socket *so, struct sockopt *sopt);
#endif /* INET */
}
mp = ⊤
do {
+ int cnt = 0;
+
if (uio == NULL) {
/*
* Data is prepackaged in "top".
mp = &m->m_next;
if (resid == 0)
break;
- } while (space > 0 && 0 /* XXX */);
+ ++cnt;
+ } while (space > 0 && cnt < tcp_sosnd_agglim);
if (flags & MSG_OOB) {
pru_flags = PRUS_OOB;
SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_max, CTLFLAG_RW,
&tcp_autorcvbuf_max, 0, "Max size of automatic receive buffer");
+int tcp_sosnd_agglim = 2;
+SYSCTL_INT(_net_inet_tcp, OID_AUTO, sosnd_agglim, CTLFLAG_RW,
+ &tcp_sosnd_agglim, 0, "TCP sosend mbuf aggregation limit");
static void tcp_dooptions(struct tcpopt *, u_char *, int, boolean_t);
static void tcp_pulloutofband(struct socket *,