-
Notifications
You must be signed in to change notification settings - Fork 228
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
Socket::ttl
and Socket::set_ttl
don't work with IPv6 sockets.
#418
Comments
Basically the same issue as #413, we need IPv4 and IPv6 versions. We should just give everything in the Lines 1077 to 1082 in 4c55898
_ipv4 suffix. Same for IPPROTO_IPV6 (Lines 1529 to 1534 in 4c55898
|
Looks like a proper solution. |
The IPv6 equivalent of |
ttl
andset_ttl
methods return an error on IPv6 sockets.Current implementations are limited to IPv4 only:
and
For IPv6 address family the proper implementations should be like
and
Unfortunately, I haven't found a reliable way to get the address family/domain of the socket instance, something like
So the possible solutions are:
Socket::domain
method, which is very system-dependent and may include:Socket::local_addr
check, which may fail for unbound sockets on some systemsgetsockopt
withSO_DOMAIN
option, which is not available on some systems.Socket::ttl_v6
andSocket::set_ttl_v6
- and leave the problem of detecting the proper address family to a library user.The text was updated successfully, but these errors were encountered: