@@ -2160,14 +2160,14 @@ impl crate::Socket {
2160
2160
2161
2161
/// Get the value of the `IP_FREEBIND` option on this socket.
2162
2162
///
2163
- /// For more information about this option, see [`set_freebind `].
2163
+ /// For more information about this option, see [`set_freebind_v4 `].
2164
2164
///
2165
- /// [`set_freebind `]: crate::Socket::set_freebind
2165
+ /// [`set_freebind_v4 `]: crate::Socket::set_freebind_v4
2166
2166
#[ cfg( all(
2167
2167
feature = "all" ,
2168
2168
any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" )
2169
2169
) ) ]
2170
- pub fn freebind ( & self ) -> io:: Result < bool > {
2170
+ pub fn freebind_v4 ( & self ) -> io:: Result < bool > {
2171
2171
unsafe {
2172
2172
getsockopt :: < c_int > ( self . as_raw ( ) , libc:: SOL_IP , libc:: IP_FREEBIND )
2173
2173
. map ( |freebind| freebind != 0 )
@@ -2185,7 +2185,7 @@ impl crate::Socket {
2185
2185
feature = "all" ,
2186
2186
any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" )
2187
2187
) ) ]
2188
- pub fn set_freebind ( & self , freebind : bool ) -> io:: Result < ( ) > {
2188
+ pub fn set_freebind_v4 ( & self , freebind : bool ) -> io:: Result < ( ) > {
2189
2189
unsafe {
2190
2190
setsockopt (
2191
2191
self . as_raw ( ) ,
@@ -2200,9 +2200,9 @@ impl crate::Socket {
2200
2200
///
2201
2201
/// This is an IPv6 counterpart of `IP_FREEBIND` socket option on
2202
2202
/// Android/Linux. For more information about this option, see
2203
- /// [`set_freebind `].
2203
+ /// [`set_freebind_v4 `].
2204
2204
///
2205
- /// [`set_freebind `]: crate::Socket::set_freebind
2205
+ /// [`set_freebind_v4 `]: crate::Socket::set_freebind_v4
2206
2206
#[ cfg( all( feature = "all" , any( target_os = "android" , target_os = "linux" ) ) ) ]
2207
2207
pub fn freebind_ipv6 ( & self ) -> io:: Result < bool > {
2208
2208
unsafe {
@@ -2215,9 +2215,9 @@ impl crate::Socket {
2215
2215
///
2216
2216
/// This is an IPv6 counterpart of `IP_FREEBIND` socket option on
2217
2217
/// Android/Linux. For more information about this option, see
2218
- /// [`set_freebind `].
2218
+ /// [`set_freebind_v4 `].
2219
2219
///
2220
- /// [`set_freebind `]: crate::Socket::set_freebind
2220
+ /// [`set_freebind_v4 `]: crate::Socket::set_freebind_v4
2221
2221
///
2222
2222
/// # Examples
2223
2223
///
@@ -2229,7 +2229,7 @@ impl crate::Socket {
2229
2229
///
2230
2230
/// fn enable_freebind(socket: &Socket) -> io::Result<()> {
2231
2231
/// match socket.domain()? {
2232
- /// Domain::IPV4 => socket.set_freebind (true)?,
2232
+ /// Domain::IPV4 => socket.set_freebind_v4 (true)?,
2233
2233
/// Domain::IPV6 => socket.set_freebind_ipv6(true)?,
2234
2234
/// _ => return Err(Error::new(ErrorKind::Other, "unsupported domain")),
2235
2235
/// };
0 commit comments