Fix: set_ipv6_multicast_hops on unix

This commit is contained in:
DaZuo0122
2026-01-16 21:49:22 +08:00
parent d3ce6b0a93
commit c367ca29e4
3 changed files with 39 additions and 14 deletions

View File

@@ -1,16 +1,17 @@
error[E0308]: mismatched types
--> crates/wtfnet-probe/src/lib.rs:477:32
Compiling wtfnet-probe v0.1.0 (/home/dazuo/rust-projects/WTFnet/crates/wtfnet-probe)
Compiling wtfnet-dns v0.1.0 (/home/dazuo/rust-projects/WTFnet/crates/wtfnet-dns)
error[E0599]: no method named `set_unicast_hops_v6` found for struct `std::net::UdpSocket` in the current scope
--> crates/wtfnet-probe/src/lib.rs:477:10
|
477 | .set_multicast_loop_v6(u32::from(ttl))
| --------------------- ^^^^^^^^^^^^^^ expected `bool`, found `u32`
| |
| arguments to this method are incorrect
476 | / socket
477 | | .set_unicast_hops_v6(u32::from(ttl))
| |_________-^^^^^^^^^^^^^^^^^^^
|
note: method defined here
--> /home/dazuo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/sr c/net/udp.rs:527:12
help: there is a method `set_multicast_loop_v6` with a similar name
|
477 - .set_unicast_hops_v6(u32::from(ttl))
477 + .set_multicast_loop_v6(u32::from(ttl))
|
527 | pub fn set_multicast_loop_v6(&self, multicast_loop_v6: bool) -> io::Result<()> {
| ^^^^^^^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0308`.
For more information about this error, try `rustc --explain E0599`.
error: could not compile `wtfnet-probe` (lib) due to 1 previous error