-
Notifications
You must be signed in to change notification settings - Fork 13.3k
UdpSocket::set_ttl does not set IPv6 hoplimit field #47727
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
Comments
set_ttl maps directly to |
@rustbot claim |
On macOS Big Sur (11.6.5) using the exact snippet from the issue description is actually failing for me with the following output:
I was able to verify the same behaviour for TcpSocket. I think at least the documentation on Should I report this as a separate issue? |
I would say, yes. This issue is for adding functionality. |
…joshtriplett add methods to TCP and UDP sockets to modify hop limit * adds methods to set value of IPV6_UNICAST_HOPS and IPV6_MULTICAST_HOPS on ipv6 sockets * I added some noop methods for different systems to keep things consistent. Maybe someone could please clarify if these noop funcs are needed? and, if so, why? Just for my own learning. This is my first addition of a new feature so let me know if I missed something in the process. I read the rustc dev guide about implementing new features but since the change here is simple, it suggested that a PR would be enough. Fixes rust-lang#47727
It is not possible to set a hoplimit in an IPv6 packet sent over UDP.
UdpSocket::set_ttl
does not modify the hoplimit in the IPv6 packet and there seems to be no other way to do so.I tried this code:
I expected to see this happen:
Since
UdpSocket
has no other function that would set the hoplimit in an IPv6 packet, I believeset_ttl
should be doing this. I expected to capture a UDP packet with an IPv6 hoplimit field of 10.Instead, this happened:
The output of the program is as expected:
I used
tcpdump -v -i lo udp port 50000
to capture the packet:The hoplimit field of the packet is still set to the default value of 64.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: