Skip to content

Commit 10e7cfd

Browse files
committed
Rename Socket::freebind_ipv6 to freebind_v6
Matching the other IPv6 socket methods.
1 parent 1ccc9a5 commit 10e7cfd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/sys/unix.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,7 +2204,7 @@ impl crate::Socket {
22042204
///
22052205
/// [`set_freebind_v4`]: crate::Socket::set_freebind_v4
22062206
#[cfg(all(feature = "all", any(target_os = "android", target_os = "linux")))]
2207-
pub fn freebind_ipv6(&self) -> io::Result<bool> {
2207+
pub fn freebind_v6(&self) -> io::Result<bool> {
22082208
unsafe {
22092209
getsockopt::<c_int>(self.as_raw(), libc::SOL_IPV6, libc::IPV6_FREEBIND)
22102210
.map(|freebind| freebind != 0)
@@ -2230,7 +2230,7 @@ impl crate::Socket {
22302230
/// fn enable_freebind(socket: &Socket) -> io::Result<()> {
22312231
/// match socket.domain()? {
22322232
/// Domain::IPV4 => socket.set_freebind_v4(true)?,
2233-
/// Domain::IPV6 => socket.set_freebind_ipv6(true)?,
2233+
/// Domain::IPV6 => socket.set_freebind_v6(true)?,
22342234
/// _ => return Err(Error::new(ErrorKind::Other, "unsupported domain")),
22352235
/// };
22362236
/// Ok(())
@@ -2242,7 +2242,7 @@ impl crate::Socket {
22422242
/// # }
22432243
/// ```
22442244
#[cfg(all(feature = "all", any(target_os = "android", target_os = "linux")))]
2245-
pub fn set_freebind_ipv6(&self, freebind: bool) -> io::Result<()> {
2245+
pub fn set_freebind_v6(&self, freebind: bool) -> io::Result<()> {
22462246
unsafe {
22472247
setsockopt(
22482248
self.as_raw(),

tests/socket.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ test!(keepalive, set_keepalive(true));
14251425
#[cfg(all(feature = "all", any(target_os = "fuchsia", target_os = "linux")))]
14261426
test!(freebind_v4, set_freebind_v4(true));
14271427
#[cfg(all(feature = "all", target_os = "linux"))]
1428-
test!(IPv6 freebind_ipv6, set_freebind_ipv6(true));
1428+
test!(IPv6 freebind_v6, set_freebind_v6(true));
14291429

14301430
test!(IPv4 ttl_v4, set_ttl_v4(40));
14311431

0 commit comments

Comments
 (0)