Merge branch 'ip6' into 'master'
Revert ip6 flag in constants, Add placeholders for ip6 feature See merge request redox-os/relibc!1425
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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::<sockaddr_in>() as socklen_t {
|
||||
unsafe { drop(Box::from_raw(bai.ai_addr.cast::<sockaddr_in>())) };
|
||||
} else if bai.ai_addrlen == mem::size_of::<sockaddr_in6>() as socklen_t {
|
||||
unsafe { drop(Box::from_raw(bai.ai_addr.cast::<sockaddr_in6>())) };
|
||||
} else {
|
||||
#[cfg(feature = "ip6")]
|
||||
if bai.ai_addrlen == mem::size_of::<sockaddr_in6>() as socklen_t {
|
||||
unsafe { drop(Box::from_raw(bai.ai_addr.cast::<sockaddr_in6>())) };
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ pub struct in_addr {
|
||||
}
|
||||
|
||||
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netinet_in.h.html>.
|
||||
#[cfg(feature = "ip6")]
|
||||
#[repr(C)]
|
||||
pub struct in6_addr {
|
||||
pub s6_addr: [u8; 16],
|
||||
@@ -40,7 +39,6 @@ pub struct sockaddr_in {
|
||||
|
||||
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netinet_in.h.html>.
|
||||
#[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 <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netinet_in.h.html>.
|
||||
#[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 <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netinet_in.h.html>.
|
||||
pub const INET_ADDRSTRLEN: c_int = 16;
|
||||
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netinet_in.h.html>.
|
||||
#[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 <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netinet_in.h.html>.
|
||||
#[cfg(feature = "ip6")]
|
||||
pub const IPPROTO_IPV6: u8 = 41;
|
||||
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netinet_in.h.html>.
|
||||
pub const IPPROTO_RAW: u8 = 0xff;
|
||||
@@ -96,29 +91,20 @@ pub const IPPROTO_MAX: u8 = 0xff;
|
||||
/// Non-POSIX, see <https://www.man7.org/linux/man-pages/man7/ip.7.html>.
|
||||
pub const IP_TTL: c_int = 2;
|
||||
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netinet_in.h.html>.
|
||||
#[cfg(feature = "ip6")]
|
||||
pub const IPV6_UNICAST_HOPS: c_int = 16;
|
||||
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netinet_in.h.html>.
|
||||
#[cfg(feature = "ip6")]
|
||||
pub const IPV6_MULTICAST_IF: c_int = 17;
|
||||
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netinet_in.h.html>.
|
||||
#[cfg(feature = "ip6")]
|
||||
pub const IPV6_MULTICAST_HOPS: c_int = 18;
|
||||
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netinet_in.h.html>.
|
||||
#[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 <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netinet_in.h.html>.
|
||||
#[cfg(feature = "ip6")]
|
||||
pub const IPV6_V6ONLY: c_int = 26;
|
||||
/// Non-POSIX, see <https://www.man7.org/linux/man-pages/man7/ip.7.html>.
|
||||
pub const IP_MULTICAST_IF: c_int = 32;
|
||||
@@ -180,14 +166,12 @@ pub struct group_source_req {
|
||||
|
||||
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netinet_in.h.html>.
|
||||
#[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 <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netinet_in.h.html>.
|
||||
#[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],
|
||||
};
|
||||
|
||||
@@ -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 <https://www.man7.org/linux/man-pages/man7/unix.7.html>.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user