Skip to content

Commit f5602ac

Browse files
committed
fix only_v6() panic on windows
The get optlen is also 1 like tcp_nodelay()
1 parent 8e2bf28 commit f5602ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/socket.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,7 @@ impl Socket {
19331933
/// [`set_only_v6`]: Socket::set_only_v6
19341934
pub fn only_v6(&self) -> io::Result<bool> {
19351935
unsafe {
1936-
getsockopt::<c_int>(self.as_raw(), sys::IPPROTO_IPV6, sys::IPV6_V6ONLY)
1936+
getsockopt::<Bool>(self.as_raw(), sys::IPPROTO_IPV6, sys::IPV6_V6ONLY)
19371937
.map(|only_v6| only_v6 != 0)
19381938
}
19391939
}

0 commit comments

Comments
 (0)