From owner-freebsd-net Sun Jan 20 11:45:24 2002 Delivered-To: freebsd-net@freebsd.org Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26]) by hub.freebsd.org (Postfix) with ESMTP id 7AA6D37B429 for ; Sun, 20 Jan 2002 11:45:10 -0800 (PST) Received: from arch20m.dellroad.org (arch20m.dellroad.org [10.1.1.20]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id LAA82042; Sun, 20 Jan 2002 11:30:03 -0800 (PST) Received: (from archie@localhost) by arch20m.dellroad.org (8.11.6/8.11.6) id g0KJU2H08589; Sun, 20 Jan 2002 11:30:02 -0800 (PST) (envelope-from archie) From: Archie Cobbs Message-Id: <200201201930.g0KJU2H08589@arch20m.dellroad.org> Subject: Re: netgraph: how to setsockopt on ksocket node ? In-Reply-To: <5390000.1011459455@blues.viagenie.qc.ca> "from Florent Parent at Jan 19, 2002 11:57:35 am" To: Florent Parent Date: Sun, 20 Jan 2002 11:30:01 -0800 (PST) Cc: Archie Cobbs , freebsd-net@FreeBSD.ORG, julian@elischer.org X-Mailer: ELM [version 2.4ME+ PL88 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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