Date: Tue, 22 Jun 2004 19:11:19 -0400 (EDT) From: Robert Watson <rwatson@freebsd.org> To: Bruce M Simpson <bms@spc.org> Cc: freebsd-gnats-submit@freebsd.org Subject: Re: kern/45733: file descriptor flags and socket flags out of sync Message-ID: <Pine.NEB.3.96L.1040622190802.61099C-100000@fledge.watson.org> In-Reply-To: <20040622225021.GH762@empiric.dek.spc.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 22 Jun 2004, Bruce M Simpson wrote: > I applied the attached patch to -CURRENT from around April which is > currently running on my local CVS server. Basic tests with sshd and ftp > didn't result in any unexpected behaviour. I suspect I really need to be > running an application similar to the one Jayanth is running to unravel > things further. > > Can anyone more familiar with the socket layer than I think of any > problems with applying it? > > Can anyone think of an application (e.g. in ports) which takes the same > order of operations as that described in the PR? Interesting problem. :-) Comments on the patch below. > Index: uipc_syscalls.c > =================================================================== > RCS file: /home/ncvs/src/sys/kern/uipc_syscalls.c,v > retrieving revision 1.181 > diff -u -r1.181 uipc_syscalls.c > --- uipc_syscalls.c 8 Apr 2004 07:14:34 -0000 1.181 > +++ uipc_syscalls.c 22 Jun 2004 22:23:16 -0000 > @@ -320,6 +320,7 @@ > /* connection has been removed from the listen queue */ > KNOTE(&head->so_rcv.sb_sel.si_note, 0); > > + so->so_state |= head->so_state; > so->so_state &= ~SS_COMP; > so->so_head = NULL; > pgid = fgetown(&head->so_sigio); Hmm. Maybe we should just copy SS_NBIO? The other SS_ flags seem inappropriate to copy. I looked at SS_ASYNC, but we fail to also propagate the socket buffer flags and it's not clear it's as meaningful, so I think just SS_NBIO. So perhaps: so->so_state |= (head->so_state & SS_NBIO); Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Senior Research Scientist, McAfee Research
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1040622190802.61099C-100000>