Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Jan 2002 11:57:35 -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:  <5390000.1011459455@blues.viagenie.qc.ca>
In-Reply-To: <200201190530.g0J5U0T27493@arch20m.dellroad.org>
References:   <200201190530.g0J5U0T27493@arch20m.dellroad.org>

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


--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=20
around the struct proc definition.  If fact, you had noted "broken"=20
probably as a memo to fix something here...

	struct proc *p =3D 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 =3D ksopt->name;
                        sopt.sopt_val =3D ksopt->value;
                        sopt.sopt_valsize =3D valsize;
!                       sopt.sopt_p =3D p;
                        error =3D sosetopt(so, &sopt);
                        break;
                    }
--- 759,765 ----
                        sopt.sopt_name =3D ksopt->name;
                        sopt.sopt_val =3D ksopt->value;
                        sopt.sopt_valsize =3D valsize;
!                       sopt.sopt_p =3D 0;
                        error =3D sosetopt(so, &sopt);
                        break;
                    }

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