Date: Fri, 18 Jan 2002 21:30:00 -0800 (PST) From: Archie Cobbs <archie@dellroad.org> To: Florent Parent <Florent.Parent@viagenie.qc.ca> Cc: freebsd-net@FreeBSD.ORG, julian@elischer.org Subject: Re: netgraph: how to setsockopt on ksocket node ? Message-ID: <200201190530.g0J5U0T27493@arch20m.dellroad.org> In-Reply-To: <214190000.1011326302@blues.viagenie.qc.ca> "from Florent Parent at Jan 17, 2002 10:58:22 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
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, NGM_KSOCKET_SETOPT, > >> (struct ng_ksocket_sockopt *)&myopts, > >> sizeof(myopts))); > >> > >> return error 14 "Bad address". > >> > >> Did some tracing in ng_ksocket.c and the struct sockopt sent as argument > >> to sosetopt() seems to contains sane values: > >> > >> sopt.sopt_val = 0xc182452c (pointer dereferences to 1) > >> sopt.sopt_valsize = 4 > netgraph: sendto(.dummy): Bad address Hmm.. I wonder if the problem is that this has never worked :-) 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? -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com 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?200201190530.g0J5U0T27493>