-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
add methods to TCP and UDP sockets to modify hop limit #94678
Conversation
r? @kennytm (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
library/std/src/net/tcp.rs
Outdated
/// stream.set_multicast_hlim_v6(88).expect("set_hop_limit_v6 call failed"); | ||
/// ``` | ||
#[unstable(feature = "ipv6_hop_limit", issue = "47727")] | ||
pub fn set_multicast_hlim_v6(&self, limit: u32) -> io::Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why thi is "hlim" here but "hop_limit" for unicast
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to keep the length of the method name from being too long. Should I change it to "hop_limit"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Rust doesn't generally abbreviate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the method names.
Since it adds new API surface: r? rust-lang/libs-api |
☔ The latest upstream changes (presumably #95565) made this pull request unmergeable. Please resolve the merge conflicts. |
This seems fine, assuming it passes CI. Let's see if the requisite constants are defined on all platforms... @bors r+ |
…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
⌛ Testing commit b3e9e94 with merge f5cfbb23b1def2ab0d4dfe01c13340628b453cd6... |
💔 Test failed - checks-actions |
The job Click to see the possible cause of the failure (guessed by this bot)
|
@bors r- Queue got messed up after a synchronize. |
☔ The latest upstream changes (presumably #98033) made this pull request unmergeable. Please resolve the merge conflicts. |
/// stream.set_hop_limit_v6(88).expect("set_hop_limit_v6 call failed"); | ||
/// ``` | ||
#[unstable(feature = "ipv6_hop_limit", issue = "47727")] | ||
pub fn set_hop_limit_v6(&self, limit: u32) -> io::Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hop Limit is an 8bit header field. So using u8
instead of u32
would reflect that better and avoid API misusage like #73158.
@kckeiks any updates on this? |
Sorry, I've been super busy, I will push an update sometime this week though. |
Just following up. My apologies, work has been keeping me exceedingly busy so I'm not sure when I'll have some bandwidth to resolve this. :/ |
That's fine, can understand. I am going to close this as it is inactive. If you find the time feel free to reöpen it or preferably create a new PR and we can take it from there. Thanks |
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 #47727