Discussion:
setsockopt with IPV6_V6ONLY fails with 10022 (WSAEINVAL) on Vista
(too old to reply)
s***@gmail.com
2007-01-31 17:35:40 UTC
Permalink
I want to change the IPV6_V6ONLY option for a UDP socket, but when I
call setsockopt with that option, it always returns WSAEINVAL. I can
call getsockopt with that option and it returns success and fills in a
1 (option is on). I tried passing it an int and a char (since
getsockopt only seems to fill in the lower 8 bits) and both fail.

Does IPV6_V6ONLY not work for UDP sockets or there something special I
need to do?
Remi Denis-Courmont
2007-01-31 18:33:18 UTC
Permalink
Post by s***@gmail.com
I want to change the IPV6_V6ONLY option for a UDP socket, but when I
call setsockopt with that option, it always returns WSAEINVAL. I can
call getsockopt with that option and it returns success and fills in a
1 (option is on). I tried passing it an int and a char (since
getsockopt only seems to fill in the lower 8 bits) and both fail.
Does IPV6_V6ONLY not work for UDP sockets or there something special I
need to do?
Did you call setsockopt before any other socket call (in particular, before
bind(), connect(), send*()...)? What did you pass as fifth parameter?
--
Rémi Denis-Courmont
http://www.remlab.net/
s***@gmail.com
2007-01-31 19:56:04 UTC
Permalink
On Jan 31, 10:33 am, Remi Denis-Courmont
Post by Remi Denis-Courmont
Did you call setsockopt before any other socket call (in particular, before
bind(), connect(), send*()...)? What did you pass as fifth parameter?
Thanks, that was it. Setting IPV6_V6ONLY before bind fixed it.

Loading...