From owner-freebsd-net Sun Jan 20 13:34:26 2002 Delivered-To: freebsd-net@freebsd.org Received: from blues.viagenie.qc.ca (modemcable114.39-130-66.mtl.mc.videotron.ca [66.130.39.114]) by hub.freebsd.org (Postfix) with ESMTP id 89F9C37B404 for ; Sun, 20 Jan 2002 13:34:20 -0800 (PST) Received: from blues.viagenie.qc.ca (blues-local [127.0.0.1]) by blues.viagenie.qc.ca (8.11.6/8.11.3) with ESMTP id g0KLY8f02200; Sun, 20 Jan 2002 16:34:08 -0500 (EST) (envelope-from Florent.Parent@viagenie.qc.ca) Date: Sun, 20 Jan 2002 16:34:05 -0500 From: Florent Parent To: Archie Cobbs Cc: freebsd-net@FreeBSD.ORG, julian@elischer.org Subject: Re: netgraph: how to setsockopt on ksocket node ? Message-ID: <135740000.1011562445@blues.viagenie.qc.ca> X-Mailer: Mulberry/2.1.2 (Linux/x86) X-PGP-Fingerprint: B718 4543 977C BE73 2BCC 23D5 3E20 4FC9 2A90 872C MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 --On 2002-01-20 11:30:01 -0800 archie@dellroad.org wrote: > > So this 'struct proc' argument can be NULL now? > What about when calling other socket functions like socreate(), et. al.? 'struct proc' member in the struct sockopt can be NULL. As per the comment=20 in that structure, NULL means that the calling entity is the kernel, not a=20 user process (my interpretation): struct sockopt { enum sopt_dir sopt_dir; /* is this a get or a set? */ int sopt_level; /* second arg of [gs]etsockopt */ int sopt_name; /* third arg of [gs]etsockopt */ void *sopt_val; /* fourth arg of [gs]etsockopt */ size_t sopt_valsize; /* (almost) fifth arg of [gs]etsockopt */ struct proc *sopt_p; /* calling process or null if kernel */ }; This doesn't apply to socreate() since it isn't passed a 'struct sockopt'=20 as argument. From a quick glance, the socket functions that are concerned=20 are sosetopt() and sogetopt(). > If so, your fix looks like the right onw. I will test the NGM_KSOCKET_GETOPT code path as I suspect that a similar=20 fix will be required. Florent. -- Florent Parent Viag=E9nie http://www.viagenie.qc.ca To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message