Skip to content

Add methods to TCP and UDP sockets to modify hop limit (refresh of #94678)#138744

Open
Mallets wants to merge 9 commits intorust-lang:mainfrom
Mallets:set_ipv6_sock_hop_limit
Open

Add methods to TCP and UDP sockets to modify hop limit (refresh of #94678)#138744
Mallets wants to merge 9 commits intorust-lang:mainfrom
Mallets:set_ipv6_sock_hop_limit

Conversation

@Mallets
Copy link
Copy Markdown

@Mallets Mallets commented Mar 20, 2025

View all comments

#94678 was closed because of time constraints of the original author (@kckeiks).

This PR is a refresh of #94678 where the original proposed changes are ported to the current status of the standard library.

In addition, this PR:

Issue: #139166

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 20, 2025

r? @ibraheemdev

rustbot has assigned @ibraheemdev.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 20, 2025
@ibraheemdev
Copy link
Copy Markdown
Member

r? libs-api because it's been a while since the original PR was approved.

@rustbot rustbot added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Mar 28, 2025
@rustbot rustbot assigned dtolnay and unassigned ibraheemdev Mar 28, 2025
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 30, 2025
@rustbot rustbot added the has-merge-commits PR has merge commits, merge with caution. label Mar 31, 2025
@rustbot

This comment has been minimized.

@Mallets Mallets force-pushed the set_ipv6_sock_hop_limit branch from 7f790e2 to 9c1ee90 Compare March 31, 2025 10:13
@rustbot rustbot removed the has-merge-commits PR has merge commits, merge with caution. label Mar 31, 2025
@bors
Copy link
Copy Markdown
Collaborator

bors commented Apr 13, 2025

☔ The latest upstream changes (presumably #139724) made this pull request unmergeable. Please resolve the merge conflicts.

@dtolnay
Copy link
Copy Markdown
Member

dtolnay commented Apr 13, 2025

Sorry—I missed that this was ready for review again. Please use @rustbot ready, which replaces S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label with S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. .

@dtolnay dtolnay force-pushed the set_ipv6_sock_hop_limit branch from 9c1ee90 to 25fb525 Compare April 13, 2025 16:23
@dtolnay
Copy link
Copy Markdown
Member

dtolnay commented Apr 13, 2025

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 13, 2025
@dtolnay
Copy link
Copy Markdown
Member

dtolnay commented Apr 13, 2025

Thank you!

@bors r+

@bors
Copy link
Copy Markdown
Collaborator

bors commented Apr 13, 2025

📌 Commit 25fb525 has been approved by dtolnay

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 13, 2025
ChrisDenton added a commit to ChrisDenton/rust that referenced this pull request Apr 13, 2025
…=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
@Mallets
Copy link
Copy Markdown
Author

Mallets commented Sep 4, 2025

@Dylan-DPC the build succeed

@bors
Copy link
Copy Markdown
Collaborator

bors commented Sep 11, 2025

☔ The latest upstream changes (presumably #146418) made this pull request unmergeable. Please resolve the merge conflicts.

@dtolnay
Copy link
Copy Markdown
Member

dtolnay commented Sep 17, 2025

You can reproduce the failure with x.py check library/std --target=wasm32-wasip2. "bors try" does not cover the full cross-compilation matrix.

Checking stage1 library artifacts{std} (stage1:x86_64-unknown-linux-gnu -> stage1:wasm32-wasip2)
    Checking std v0.0.0
warning: dropping unsupported crate type `dylib` for target `wasm32-wasip2`

error[E0425]: cannot find value `IPV6_MULTICAST_HOPS` in crate `c`
   --> library/std/src/sys/net/connection/socket/mod.rs:831:53
    |
831 |         setsockopt(&self.inner, c::IPPROTO_IPV6, c::IPV6_MULTICAST_HOPS, limit as c_int)
    |                                                     ^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `IPV6_MULTICAST_LOOP`
    |
   ::: /home/david/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.175/src/wasi/p2.rs:117:1
    |
117 | pub const IPV6_MULTICAST_LOOP: c_int = 19;
    | ------------------------------------ similarly named constant `IPV6_MULTICAST_LOOP` defined here

error[E0425]: cannot find value `IPV6_MULTICAST_HOPS` in crate `c`
   --> library/std/src/sys/net/connection/socket/mod.rs:835:70
    |
835 |         let raw: c_int = getsockopt(&self.inner, c::IPPROTO_IPV6, c::IPV6_MULTICAST_HOPS)?;
    |                                                                      ^^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `IPV6_MULTICAST_LOOP`
    |
   ::: /home/david/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.175/src/wasi/p2.rs:117:1
    |
117 | pub const IPV6_MULTICAST_LOOP: c_int = 19;
    | ------------------------------------ similarly named constant `IPV6_MULTICAST_LOOP` defined here

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot rustbot added the has-merge-commits PR has merge commits, merge with caution. label Sep 20, 2025
@Mallets Mallets force-pushed the set_ipv6_sock_hop_limit branch from cfe9d15 to a9dbefc Compare September 20, 2025 09:20
@rustbot

This comment has been minimized.

@rustbot rustbot removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. has-merge-commits PR has merge commits, merge with caution. labels Sep 20, 2025
@Mallets Mallets force-pushed the set_ipv6_sock_hop_limit branch from a9dbefc to 9698730 Compare September 20, 2025 09:24
@dtolnay dtolnay added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 23, 2025
@bors
Copy link
Copy Markdown
Collaborator

bors commented Dec 24, 2025

☔ The latest upstream changes (presumably #150334) made this pull request unmergeable. Please resolve the merge conflicts.

@Dylan-DPC
Copy link
Copy Markdown
Member

@Mallets any updates on this? thanks

@Mallets Mallets force-pushed the set_ipv6_sock_hop_limit branch from 9698730 to b3c63c8 Compare March 24, 2026 11:10
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 24, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@Mallets
Copy link
Copy Markdown
Author

Mallets commented Mar 24, 2026

@Dylan-DPC, thank you for the reminder! I had completely overlooked this PR.
I’ve now updated it, and the CI seems to pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-windows Operating system: Windows S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants