Subject: _almost_ all socket options inherit across accept()?
To: None <tech-net@netbsd.org>
From: Thor Lancelot Simon <tls@coyotepoint.com>
List: tech-net
Date: 07/03/2007 18:12:43
Now that Matt Thomas helped me understand where the listen socket's options
are copied to the accept socket, I think the following patch is required for
the low-water marks to inherit across accept() like the other socket options.
All else seems to be copied correctly already.
Opinions?
Index: uipc_socket2.c
===================================================================
RCS file: /cvsroot/src/sys/kern/uipc_socket2.c,v
retrieving revision 1.82
diff -c -r1.82 uipc_socket2.c
*** uipc_socket2.c 4 Mar 2007 06:03:11 -0000 1.82
--- uipc_socket2.c 3 Jul 2007 22:12:15 -0000
***************
*** 180,185 ****
--- 180,187 ----
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,