Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Jan 2002 23:31:20 -0800
From:      Julian Elischer <julian@elischer.org>
To:        Florent Parent <Florent.Parent@viagenie.qc.ca>
Cc:        Archie Cobbs <archie@dellroad.org>, freebsd-net@FreeBSD.ORG
Subject:   Re: netgraph: how to setsockopt on ksocket node ?
Message-ID:  <3C54FE47.81C90C55@elischer.org>
References:  <200201190530.g0J5U0T27493@arch20m.dellroad.org> <5390000.1011459455@blues.viagenie.qc.ca>

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

Archie do you want to check this in, or shall I?

Florent Parent wrote:
> 
> --On 2002-01-18 21:30:00 -0800 archie@dellroad.org 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 using this ;-)
> 
> > That is, maybe setsockopt() is expecting the value pointer to point
> > into user memory, while ng_ksocket is using a pointer that points
> > into kernel memory?
> >
> > In which case, I don't know how to go about fixing it.. Julian?
> 
> 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;
>                     }
> 
> Florent.
> --
> Florent Parent
> Viagénie  http://www.viagenie.qc.ca

-- 
+------------------------------------+       ______ _  __
|   __--_|\  Julian Elischer         |       \     U \/ / hard at work in 
|  /       \ julian@elischer.org     +------>x   USA    \ a very strange
| (   OZ    )                                \___   ___ | country !
+- X_.---._/    presently in San Francisco       \_/   \\
          v

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?3C54FE47.81C90C55>