Skip to content

Commit 23ccadd

Browse files
committed
Auto merge of #33124 - sfackler:kill-ipv6-only, r=alexcrichton
Remove IPV6_V6ONLY functionality These settings can only be adjusted before bind time, which doesn't make sense in the current set of functionality. These methods are stable, but haven't hit a stable release yet. Closes #33052 [breaking-change] r? @alexcrichton Will also need a backport to the beta.
2 parents ebff638 + c6480e8 commit 23ccadd

File tree

3 files changed

+0
-64
lines changed

3 files changed

+0
-64
lines changed

src/libstd/net/tcp.rs

-23
Original file line numberDiff line numberDiff line change
@@ -221,29 +221,6 @@ impl TcpStream {
221221
self.0.ttl()
222222
}
223223

224-
/// Sets the value for the `IPV6_V6ONLY` option on this socket.
225-
///
226-
/// If this is set to `true` then the socket is restricted to sending and
227-
/// receiving IPv6 packets only. If this is the case, an IPv4 and an IPv6
228-
/// application can each bind the same port at the same time.
229-
///
230-
/// If this is set to `false` then the socket can be used to send and
231-
/// receive packets from an IPv4-mapped IPv6 address.
232-
#[stable(feature = "net2_mutators", since = "1.9.0")]
233-
pub fn set_only_v6(&self, only_v6: bool) -> io::Result<()> {
234-
self.0.set_only_v6(only_v6)
235-
}
236-
237-
/// Gets the value of the `IPV6_V6ONLY` option for this socket.
238-
///
239-
/// For more information about this option, see [`set_only_v6`][link].
240-
///
241-
/// [link]: #method.set_only_v6
242-
#[stable(feature = "net2_mutators", since = "1.9.0")]
243-
pub fn only_v6(&self) -> io::Result<bool> {
244-
self.0.only_v6()
245-
}
246-
247224
/// Get the value of the `SO_ERROR` option on this socket.
248225
///
249226
/// This will retrieve the stored error in the underlying socket, clearing

src/libstd/net/udp.rs

-23
Original file line numberDiff line numberDiff line change
@@ -243,29 +243,6 @@ impl UdpSocket {
243243
self.0.ttl()
244244
}
245245

246-
/// Sets the value for the `IPV6_V6ONLY` option on this socket.
247-
///
248-
/// If this is set to `true` then the socket is restricted to sending and
249-
/// receiving IPv6 packets only. If this is the case, an IPv4 and an IPv6
250-
/// application can each bind the same port at the same time.
251-
///
252-
/// If this is set to `false` then the socket can be used to send and
253-
/// receive packets from an IPv4-mapped IPv6 address.
254-
#[stable(feature = "net2_mutators", since = "1.9.0")]
255-
pub fn set_only_v6(&self, only_v6: bool) -> io::Result<()> {
256-
self.0.set_only_v6(only_v6)
257-
}
258-
259-
/// Gets the value of the `IPV6_V6ONLY` option for this socket.
260-
///
261-
/// For more information about this option, see [`set_only_v6`][link].
262-
///
263-
/// [link]: #method.set_only_v6
264-
#[stable(feature = "net2_mutators", since = "1.9.0")]
265-
pub fn only_v6(&self) -> io::Result<bool> {
266-
self.0.only_v6()
267-
}
268-
269246
/// Executes an operation of the `IP_ADD_MEMBERSHIP` type.
270247
///
271248
/// This function specifies a new multicast group for this socket to join.

src/libstd/sys/common/net.rs

-18
Original file line numberDiff line numberDiff line change
@@ -247,15 +247,6 @@ impl TcpStream {
247247
Ok(raw as u32)
248248
}
249249

250-
pub fn set_only_v6(&self, only_v6: bool) -> io::Result<()> {
251-
setsockopt(&self.inner, c::IPPROTO_IPV6, c::IPV6_V6ONLY, only_v6 as c_int)
252-
}
253-
254-
pub fn only_v6(&self) -> io::Result<bool> {
255-
let raw: c_int = getsockopt(&self.inner, c::IPPROTO_IPV6, c::IPV6_V6ONLY)?;
256-
Ok(raw != 0)
257-
}
258-
259250
pub fn take_error(&self) -> io::Result<Option<io::Error>> {
260251
self.inner.take_error()
261252
}
@@ -544,15 +535,6 @@ impl UdpSocket {
544535
Ok(raw as u32)
545536
}
546537

547-
pub fn set_only_v6(&self, only_v6: bool) -> io::Result<()> {
548-
setsockopt(&self.inner, c::IPPROTO_IPV6, c::IPV6_V6ONLY, only_v6 as c_int)
549-
}
550-
551-
pub fn only_v6(&self) -> io::Result<bool> {
552-
let raw: c_int = getsockopt(&self.inner, c::IPPROTO_IPV6, c::IPV6_V6ONLY)?;
553-
Ok(raw != 0)
554-
}
555-
556538
pub fn take_error(&self) -> io::Result<Option<io::Error>> {
557539
self.inner.take_error()
558540
}

0 commit comments

Comments
 (0)