Copy SNDLOWAT and RCVLOWAT socket options to accepted socket, so applications

can rely on all socket options being propagated from the listen socket as
the manual page says (and as everything but Linux has always done).  FreeBSD 6
fixes this the same way, but this bug appears elsewhere and is...Old.
This commit is contained in:
tls 2007-07-04 07:13:13 +00:00
parent 511f2bb7af
commit d11e46a459
1 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uipc_socket2.c,v 1.82 2007/03/04 06:03:11 christos Exp $ */
/* $NetBSD: uipc_socket2.c,v 1.83 2007/07/04 07:13:13 tls Exp $ */
/*
* Copyright (c) 1982, 1986, 1988, 1990, 1993
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.82 2007/03/04 06:03:11 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.83 2007/07/04 07:13:13 tls Exp $");
#include "opt_mbuftrace.h"
#include "opt_sb_max.h"
@ -180,6 +180,8 @@ sonewconn(struct socket *head, int connstatus)
so->so_snd.sb_mowner = head->so_snd.sb_mowner;
#endif
(void) soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat);
so->so_snd.sb_lowat = head->so_snd.sb_lowat;
so->so_rcv.sb_lowat = head->so_rcv.sb_lowat;
soqinsque(head, so, soqueue);
if ((*so->so_proto->pr_usrreq)(so, PRU_ATTACH,
(struct mbuf *)0, (struct mbuf *)0, (struct mbuf *)0,