Discussion:
_almost_ all socket options inherit across accept()?
(too old to reply)
Thor Lancelot Simon
2007-07-03 22:12:43 UTC
Permalink
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,

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Christos Zoulas
2007-07-04 04:03:48 UTC
Permalink
Post by Thor Lancelot Simon
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,
I think that the change is correct.

christos



--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...