Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Jan 2002 16:34:05 -0500
From:      Florent Parent <Florent.Parent@viagenie.qc.ca>
To:        Archie Cobbs <archie@dellroad.org>
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>

next in thread | raw e-mail | index | archive | help


--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




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