@@ -1165,8 +1165,8 @@ impl Socket {
1165
1165
///
1166
1166
/// [`SOCK_RAW`]: Type::RAW
1167
1167
/// [raw(7)]: https://man7.org/linux/man-pages/man7/raw.7.html
1168
- /// [`IP_TTL`]: Socket::set_ttl
1169
1168
/// [`IP_TOS`]: Socket::set_tos
1169
+ /// [`IP_TTL`]: Socket::set_ttl_v4
1170
1170
#[ cfg_attr(
1171
1171
any( target_os = "fuchsia" , target_os = "illumos" , target_os = "solaris" ) ,
1172
1172
allow( rustdoc:: broken_intra_doc_links)
@@ -1531,10 +1531,10 @@ impl Socket {
1531
1531
1532
1532
/// Get the value of the `IP_TTL` option for this socket.
1533
1533
///
1534
- /// For more information about this option, see [`set_ttl `].
1534
+ /// For more information about this option, see [`set_ttl_v4 `].
1535
1535
///
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 > {
1538
1538
unsafe {
1539
1539
getsockopt :: < c_int > ( self . as_raw ( ) , sys:: IPPROTO_IP , sys:: IP_TTL ) . map ( |ttl| ttl as u32 )
1540
1540
}
@@ -1544,7 +1544,7 @@ impl Socket {
1544
1544
///
1545
1545
/// This value sets the time-to-live field that is used in every packet sent
1546
1546
/// from this socket.
1547
- pub fn set_ttl ( & self , ttl : u32 ) -> io:: Result < ( ) > {
1547
+ pub fn set_ttl_v4 ( & self , ttl : u32 ) -> io:: Result < ( ) > {
1548
1548
unsafe { setsockopt ( self . as_raw ( ) , sys:: IPPROTO_IP , sys:: IP_TTL , ttl as c_int ) }
1549
1549
}
1550
1550
0 commit comments