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 [EMAIL PROTECTED] with "unsubscribe freebsd-net" in the body of the message