@@ -1165,8 +1165,8 @@ impl Socket {
11651165 ///
11661166 /// [`SOCK_RAW`]: Type::RAW
11671167 /// [raw(7)]: https://man7.org/linux/man-pages/man7/raw.7.html
1168- /// [`IP_TTL`]: Socket::set_ttl
11691168 /// [`IP_TOS`]: Socket::set_tos
1169+ /// [`IP_TTL`]: Socket::set_ttl_v4
11701170 #[ cfg_attr(
11711171 any( target_os = "fuchsia" , target_os = "illumos" , target_os = "solaris" ) ,
11721172 allow( rustdoc:: broken_intra_doc_links)
@@ -1531,10 +1531,10 @@ impl Socket {
15311531
15321532 /// Get the value of the `IP_TTL` option for this socket.
15331533 ///
1534- /// For more information about this option, see [`set_ttl `].
1534+ /// For more information about this option, see [`set_ttl_v4 `].
15351535 ///
1536- /// [`set_ttl `]: Socket::set_ttl
1537- pub fn ttl ( & self ) -> io:: Result < u32 > {
1536+ /// [`set_ttl_v4 `]: Socket::set_ttl_v4
1537+ pub fn ttl_v4 ( & self ) -> io:: Result < u32 > {
15381538 unsafe {
15391539 getsockopt :: < c_int > ( self . as_raw ( ) , sys:: IPPROTO_IP , sys:: IP_TTL ) . map ( |ttl| ttl as u32 )
15401540 }
@@ -1544,7 +1544,7 @@ impl Socket {
15441544 ///
15451545 /// This value sets the time-to-live field that is used in every packet sent
15461546 /// from this socket.
1547- pub fn set_ttl ( & self , ttl : u32 ) -> io:: Result < ( ) > {
1547+ pub fn set_ttl_v4 ( & self , ttl : u32 ) -> io:: Result < ( ) > {
15481548 unsafe { setsockopt ( self . as_raw ( ) , sys:: IPPROTO_IP , sys:: IP_TTL , ttl as c_int ) }
15491549 }
15501550
0 commit comments