diff --git a/Cargo.toml b/Cargo.toml index 11ebb98a14..0beb3d5308 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -135,7 +135,6 @@ math_libm = [] no_trace = ["log/release_max_level_debug"] # for very verbose activity beyond trace level trace_tls = [] -ip6 = [] [profile.dev] panic = "abort" diff --git a/src/header/netdb/mod.rs b/src/header/netdb/mod.rs index ea82382d45..e5fb4cb521 100644 --- a/src/header/netdb/mod.rs +++ b/src/header/netdb/mod.rs @@ -31,7 +31,6 @@ use crate::{ raw_cell::RawCell, }; -#[cfg(feature = "ip6")] use crate::header::netinet_in::sockaddr_in6; #[cfg(target_os = "linux")] @@ -1061,14 +1060,9 @@ pub unsafe extern "C" fn freeaddrinfo(res: *mut addrinfo) { if !bai.ai_addr.is_null() { if bai.ai_addrlen == mem::size_of::() as socklen_t { unsafe { drop(Box::from_raw(bai.ai_addr.cast::())) }; + } else if bai.ai_addrlen == mem::size_of::() as socklen_t { + unsafe { drop(Box::from_raw(bai.ai_addr.cast::())) }; } else { - #[cfg(feature = "ip6")] - if bai.ai_addrlen == mem::size_of::() as socklen_t { - unsafe { drop(Box::from_raw(bai.ai_addr.cast::())) }; - } else { - todo_skip!(0, "freeaddrinfo: unknown ai_addrlen {}", bai.ai_addrlen); - } - #[cfg(not(feature = "ip6"))] todo_skip!(0, "freeaddrinfo: unknown ai_addrlen {}", bai.ai_addrlen); } } diff --git a/src/header/netinet_in/mod.rs b/src/header/netinet_in/mod.rs index a60c728af8..0e4ced5c15 100644 --- a/src/header/netinet_in/mod.rs +++ b/src/header/netinet_in/mod.rs @@ -22,7 +22,6 @@ pub struct in_addr { } /// See . -#[cfg(feature = "ip6")] #[repr(C)] pub struct in6_addr { pub s6_addr: [u8; 16], @@ -40,7 +39,6 @@ pub struct sockaddr_in { /// See . #[repr(C)] -#[cfg(feature = "ip6")] pub struct sockaddr_in6 { pub sin6_family: sa_family_t, pub sin6_port: in_port_t, @@ -51,7 +49,6 @@ pub struct sockaddr_in6 { /// See . #[repr(C)] -#[cfg(feature = "ip6")] pub struct ipv6_mreq { pub ipv6mr_multiaddr: in6_addr, pub ipv6mr_interface: u32, @@ -61,7 +58,6 @@ pub struct ipv6_mreq { /// See . pub const INET_ADDRSTRLEN: c_int = 16; /// See . -#[cfg(feature = "ip6")] pub const INET6_ADDRSTRLEN: c_int = 46; // IP options @@ -86,7 +82,6 @@ pub const IPPROTO_UDP: u8 = 17; /// Non-POSIX. pub const IPPROTO_IDP: u8 = 22; /// See . -#[cfg(feature = "ip6")] pub const IPPROTO_IPV6: u8 = 41; /// See . pub const IPPROTO_RAW: u8 = 0xff; @@ -96,29 +91,20 @@ pub const IPPROTO_MAX: u8 = 0xff; /// Non-POSIX, see . pub const IP_TTL: c_int = 2; /// See . -#[cfg(feature = "ip6")] pub const IPV6_UNICAST_HOPS: c_int = 16; /// See . -#[cfg(feature = "ip6")] pub const IPV6_MULTICAST_IF: c_int = 17; /// See . -#[cfg(feature = "ip6")] pub const IPV6_MULTICAST_HOPS: c_int = 18; /// See . -#[cfg(feature = "ip6")] pub const IPV6_MULTICAST_LOOP: c_int = 19; /// Non-POSIX. -#[cfg(feature = "ip6")] pub const IPV6_ADD_MEMBERSHIP: c_int = 20; -#[cfg(feature = "ip6")] pub const IPV6_JOIN_GROUP: c_int = 20; /// Non-POSIX. -#[cfg(feature = "ip6")] pub const IPV6_DROP_MEMBERSHIP: c_int = 21; -#[cfg(feature = "ip6")] pub const IPV6_LEAVE_GROUP: c_int = 21; /// See . -#[cfg(feature = "ip6")] pub const IPV6_V6ONLY: c_int = 26; /// Non-POSIX, see . pub const IP_MULTICAST_IF: c_int = 32; @@ -180,14 +166,12 @@ pub struct group_source_req { /// See . #[unsafe(no_mangle)] -#[cfg(feature = "ip6")] pub static in6addr_any: in6_addr = in6_addr { s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], }; /// See . #[unsafe(no_mangle)] -#[cfg(feature = "ip6")] pub static in6addr_loopback: in6_addr = in6_addr { s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], }; diff --git a/src/header/sys_socket/constants.rs b/src/header/sys_socket/constants.rs index faeca8331a..f043163a74 100644 --- a/src/header/sys_socket/constants.rs +++ b/src/header/sys_socket/constants.rs @@ -168,7 +168,6 @@ pub const MCAST_LEAVE_SOURCE_GROUP: c_int = 47; /// Internet domain sockets for use with IPv4 sockets. pub const AF_INET: c_int = 2; /// Internet domain sockets for use with IPv6 sockets. -#[cfg(feature = "ip6")] pub const AF_INET6: c_int = 10; /// Non-POSIX, see . ///