Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setsockopt IPV6_V6ONLY does not work #128

Closed
anders opened this issue Apr 11, 2016 · 4 comments
Closed

setsockopt IPV6_V6ONLY does not work #128

anders opened this issue Apr 11, 2016 · 4 comments

Comments

@anders
Copy link

anders commented Apr 11, 2016

# python
>>> import socket
>>> s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM, 0)
>>> s.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 22] Invalid argument
@hungys
Copy link

hungys commented Apr 11, 2016

Seems the same issue as #68

@sunilmut
Copy link
Member

@anders Can confirm from our side that the socket option IPPROTO_IPV6\IPV6_V6ONLY is not yet implemented. We have opened a bug on our side to track this. No ETA at this time.

@russalex russalex added the fixed label Jun 10, 2016
@russalex
Copy link
Contributor

Looks to be fixed in 14361:

Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM, 0)
>>> s.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 1)
>>>

@adcen0107
Copy link

do this
int flag = 1;
int ret = setsockopt(sock_fd, IPPROTO_IPV6, IPV6_V6ONLY, &flag, sizeof(flag));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants