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
What kind of socket? What version of FreeBSD? That should work.. if the error is coming from the sosetopt() call then it's a socket problem rather than a netgraph problem. What if you create the socket normally and call setsockopt()? Cheers, -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