Re: netgraph: how to setsockopt on ksocket node ?

2002-01-27 Thread Julian Elischer
Archie do you want to check this in, or shall I? Florent Parent wrote: --On 2002-01-18 21:30:00 -0800 [EMAIL PROTECTED] wrote: netgraph: sendto(.dummy): Bad address Hmm.. I wonder if the problem is that this has never worked :-) That would explain why I couldn't find any examples on

Re: netgraph: how to setsockopt on ksocket node ?

2002-01-21 Thread John Polstra
In article [EMAIL PROTECTED], Garrett Wollman [EMAIL PROTECTED] wrote: On Sun, 20 Jan 2002 15:08:56 -0800 (PST), Archie Cobbs [EMAIL PROTECTED] said: But it's interesting the soalloc() is called with 'p != 0' as an argument. p is never 0 or else you would have already panic'd... you'd

Re: netgraph: how to setsockopt on ksocket node ?

2002-01-20 Thread Archie Cobbs
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 */ ***

Re: netgraph: how to setsockopt on ksocket node ?

2002-01-20 Thread Florent Parent
--On 2002-01-20 11:30:01 -0800 [EMAIL PROTECTED] 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 in that structure, NULL means that

Re: netgraph: how to setsockopt on ksocket node ?

2002-01-20 Thread Archie Cobbs
Florent Parent writes: 'struct proc' member in the struct sockopt can be NULL. As per the comment in that structure, NULL means that the calling entity is the kernel, not a user process (my interpretation): struct sockopt { enumsopt_dir sopt_dir; /* is this a get or a set? */

Re: netgraph: how to setsockopt on ksocket node ?

2002-01-20 Thread Garrett Wollman
On Sun, 20 Jan 2002 15:08:56 -0800 (PST), Archie Cobbs [EMAIL PROTECTED] said: But it's interesting the soalloc() is called with 'p != 0' as an argument. p is never 0 or else you would have already panic'd... you'd panic later on, too, referencing 'p-p_ucred'. All of the credential frobbing

Re: netgraph: how to setsockopt on ksocket node ?

2002-01-20 Thread Archie Cobbs
Florent Parent writes: 'struct proc' member in the struct sockopt can be NULL. As per the comment in that structure, NULL means that the calling entity is the kernel, not a user process (my interpretation): struct sockopt { enumsopt_dir sopt_dir; /* is this a get or a set? */

Re: netgraph: how to setsockopt on ksocket node ?

2002-01-18 Thread Rogier R. Mulhuijzen
Hi Florent, You use: struct opts { int level; int name; int value; } myopts; myopts.level = SOL_SOCKET; myopts.name = SO_REUSEPORT; myopts.value = 1; But socket options (on this level) are a predefined struct. Here's an example from some

Re: netgraph: how to setsockopt on ksocket node ?

2002-01-18 Thread Florent Parent
--On 2002-01-18 11:55:09 +0100 [EMAIL PROTECTED] wrote: But socket options (on this level) are a predefined struct. Here's an example from some code I am working on: struct sockopt sopt; /* some code removed */ bzero(sopt, sizeof(sopt)); sopt.sopt_level =

Re: netgraph: how to setsockopt on ksocket node ?

2002-01-18 Thread Archie Cobbs
Florent Parent writes: Anyone has an example on how to setsockopt on a ksocket node in netgraph? struct opts { int level; int name; int value; } myopts = { SOL_SOCKET, SO_REUSEADDR, 1 }; ret = NgSendMsg(cs, epath, NGM_KSOCKET_COOKIE,

netgraph: how to setsockopt on ksocket node ?

2002-01-17 Thread Florent Parent
Anyone has an example on how to setsockopt on a ksocket node in netgraph? struct opts { int level; int name; int value; } myopts = { SOL_SOCKET, SO_REUSEADDR, 1 }; ret = NgSendMsg(cs, epath, NGM_KSOCKET_COOKIE, NGM_KSOCKET_SETOPT,

Re: netgraph: how to setsockopt on ksocket node ?

2002-01-17 Thread Julian Elischer
archie is Mr ksocket. On Thu, 17 Jan 2002, Florent Parent wrote: --On 2002-01-17 19:11:45 +0100 [EMAIL PROTECTED] wrote: ret = NgSendMsg(cs, epath, NGM_KSOCKET_COOKIE, NGM_KSOCKET_SETOPT, (struct ng_ksocket_sockopt *)myopts, sizeof(myopts)));

Re: netgraph: how to setsockopt on ksocket node ?

2002-01-17 Thread Archie Cobbs
Florent Parent writes: Anyone has an example on how to setsockopt on a ksocket node in netgraph? struct opts { int level; int name; int value; } myopts = { SOL_SOCKET, SO_REUSEADDR, 1 }; ret = NgSendMsg(cs, epath, NGM_KSOCKET_COOKIE,

Re: netgraph: how to setsockopt on ksocket node ?

2002-01-17 Thread Florent Parent
--On 2002-01-17 18:16:08 -0800 [EMAIL PROTECTED] wrote: Florent Parent writes: Anyone has an example on how to setsockopt on a ksocket node in netgraph? struct opts { int level; int name; int value; } myopts = { SOL_SOCKET, SO_REUSEADDR, 1 };