Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Jan 2002 11:30:01 -0800 (PST)
From:      Archie Cobbs <archie@dellroad.org>
To:        Florent Parent <Florent.Parent@viagenie.qc.ca>
Cc:        Archie Cobbs <archie@dellroad.org>, freebsd-net@FreeBSD.ORG, julian@elischer.org
Subject:   Re: netgraph: how to setsockopt on ksocket node ?
Message-ID:  <200201201930.g0KJU2H08589@arch20m.dellroad.org>
In-Reply-To: <5390000.1011459455@blues.viagenie.qc.ca> "from Florent Parent at Jan 19, 2002 11:57:35 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Florent Parent writes:
> This is what I did to make it work for me. A better fix would probably be 
> around the struct proc definition.  If fact, you had noted "broken" 
> probably as a memo to fix something here...
> 
> 	struct proc *p = curproc ? curproc : &proc0;	/* XXX broken */
> 
> 
> *** ng_ksocket.c.orig   Sat Jan 19 11:05:28 2002
> --- ng_ksocket.c        Sat Jan 19 11:45:23 2002
> ***************
> *** 759,765 ****
>                         sopt.sopt_name = ksopt->name;
>                         sopt.sopt_val = ksopt->value;
>                         sopt.sopt_valsize = valsize;
> !                       sopt.sopt_p = p;
>                         error = sosetopt(so, &sopt);
>                         break;
>                     }
> --- 759,765 ----
>                         sopt.sopt_name = ksopt->name;
>                         sopt.sopt_val = ksopt->value;
>                         sopt.sopt_valsize = valsize;
> !                       sopt.sopt_p = 0;
>                         error = sosetopt(so, &sopt);
>                         break;
>                     }

Wow, didn't know you could do that :-)

My understanding of the use of that parameter is very incomplete.
I just copied what was found in the NFS code at the time (since
it also makes use of a socket in the kernel).

So this 'struct proc' argument can be NULL now? What about when
calling other socket functions like socreate(), et. al.? 
If so, your fix looks like the right onw.

-Archie

__________________________________________________________________________
Archie Cobbs     *     Packet Design     *     http://www.packetdesign.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200201201930.g0KJU2H08589>