add methods to TCP and UDP sockets to modify hop limit#94678
add methods to TCP and UDP sockets to modify hop limit#94678kckeiks wants to merge 7 commits intorust-lang:masterfrom
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.
why thi is "hlim" here but "hop_limit" for unicast
There was a problem hiding this comment.
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.
Yes. Rust doesn't generally abbreviate.
There was a problem hiding this comment.
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+ |
|
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.
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 |
…=dtolnay Add methods to TCP and UDP sockets to modify hop limit (refresh of rust-lang#94678) rust-lang#94678 was closed because of time constraints of the original author (`@kckeiks).` This PR is a refresh of rust-lang#94678 where the original proposed changes are ported to the current status of the standard library. In addition, this PR: - implements the change suggested in rust-lang#94678 (comment) - defines `set_multicast_hop_limit_v6` and `multicast_hop_limit_v6 ` only for UDP sockets and not for TCP sockets as originally proposed Issue: rust-lang#139166
…=dtolnay Add methods to TCP and UDP sockets to modify hop limit (refresh of rust-lang#94678) rust-lang#94678 was closed because of time constraints of the original author (``@kckeiks).`` This PR is a refresh of rust-lang#94678 where the original proposed changes are ported to the current status of the standard library. In addition, this PR: - implements the change suggested in rust-lang#94678 (comment) - defines `set_multicast_hop_limit_v6` and `multicast_hop_limit_v6 ` only for UDP sockets and not for TCP sockets as originally proposed Issue: rust-lang#139166
…enton Rollup of 12 pull requests Successful merges: - rust-lang#138744 (Add methods to TCP and UDP sockets to modify hop limit (refresh of rust-lang#94678)) - rust-lang#138962 (Expect an array when expected and acutal types are both arrays during cast) - rust-lang#139001 (add `naked_functions_rustic_abi` feature gate) - rust-lang#139379 (Use delayed bug for normalization errors in drop elaboration) - rust-lang#139582 (Various coercion cleanups) - rust-lang#139628 (Suggest remove redundant `$()?` around `vis`) - rust-lang#139644 (Micro-optimize `InstSimplify`'s `simplify_primitive_clone`) - rust-lang#139666 (cleanup `mir_borrowck`) - rust-lang#139674 (In `rustc_mir_transform`, iterate over index newtypes instead of ints) - rust-lang#139695 (compiletest: consistently use `camino::{Utf8Path,Utf8PathBuf}` throughout) - rust-lang#139722 (Move some things to rustc_type_ir) - rust-lang#139740 (Convert `tests/ui/lint/dead-code/self-assign.rs` to a known-bug test) r? `@ghost` `@rustbot` modify labels: rollup
…=dtolnay Add methods to TCP and UDP sockets to modify hop limit (refresh of rust-lang#94678) rust-lang#94678 was closed because of time constraints of the original author (`@kckeiks).` This PR is a refresh of rust-lang#94678 where the original proposed changes are ported to the current status of the standard library. In addition, this PR: - implements the change suggested in rust-lang#94678 (comment) - defines `set_multicast_hop_limit_v6` and `multicast_hop_limit_v6 ` only for UDP sockets and not for TCP sockets as originally proposed Issue: rust-lang#139166
Rollup of 9 pull requests Successful merges: - #134696 (Implement `normalize_lexically`) - #138744 (Add methods to TCP and UDP sockets to modify hop limit (refresh of #94678)) - #140539 (Simplify `attribute_groups`) - #140863 ([rustdoc] Unify type aliases rendering with other ADT) - #140936 (Clarify WTF-8 safety docs) - #140952 (Specify that split_ascii_whitespace uses the same definition as is_ascii_whitespace) - #141472 (Attempt to improve the `std::fs::create_dir_all` docs related to atomicity) - #141502 (ci: move PR job x86_64-gnu-tools to codebuild) - #141559 (const-check: stop recommending the use of rustc_allow_const_fn_unstable) r? `@ghost` `@rustbot` modify labels: rollup
Add methods to TCP and UDP sockets to modify hop limit (refresh of #94678)
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