Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/net



On Thu, Apr 03, 2008 at 12:19:37PM +0100, Andrew Doran wrote:
> On Thu, Apr 03, 2008 at 07:19:33AM +0000, David Young wrote:
> > 
> > Module Name:        src
> > Committed By:       dyoung
> > Date:               Thu Apr  3 07:19:33 UTC 2008
> > 
> > Modified Files:
> >     src/sys/net: if_gre.c
> > 
> > Log Message:
> > Fix one of two bugs introduced by the descriptor handling changes
> > (rev 1.125): correct the check for fd_getsock() failure in
> > gre_socreate().
> > 
> > The second bug is more complicated to fix.  Since rev 1.125,
> > gre_reconf() is using the file descriptor table of the current
> > process instead of the process 0's (the kernel's).
> 
> I think there was already confusion about which descriptor was being used, I
> meant to file a PR about that but forgot. Maybe the easiest way to solve
> this is to have the descriptor modifying operations always run in proc0's
> context. I'll look again.

In order to delegate a file from procN to proc0, gre relied heavily on the
fact that it could pass the file descriptor routines both a descriptor
and a LWP.  It passed either curlwp or sc->sc_lwp, where sc->sc_lwp
== lwp0.  With revision 1.125, some calls in gre_reconf() to fd*(fd,
sc->sc_lwp) became fd*(fd).  Now, curlwp is implied where gre_reconf()
used to pass sc->sc_lwp.  That is where the problems arise.

Today I have experimented with running gre_reconf() in proc0's context,
using a kthread, but I had to add about 70 lines of code just to get
gre to work as it did before.

Dave

-- 
David Young             OJC Technologies
dyoung%ojctech.com@localhost      Urbana, IL * (217) 278-3933 ext 24


Home | Main Index | Thread Index | Old Index