relibc: fix denied warnings in socket.rs IPv6 code

Two cross-compile-specific denied warnings that blocked the
canonical build:

1. unused import: in6_addr (line 23)
   The parallel agent's IPv6 work imported in6_addr but never
   referenced the type directly. Removed from the import list.

2. unnecessary unsafe block (line 76)
   'let addr = unsafe { &data.sin6_addr.s6_addr };' — 'data' was
   already a safe &sockaddr_in6 reference (created by the unsafe
   cast on line 75). Field access on a safe reference doesn't
   require unsafe. Removed the wrapper.

Both are -D warnings during -Z build-std cross-compile but not
during host cargo check. This was the last blocker for ISO
production (relibc is a prefix dependency).
This commit is contained in:
Red Bear OS
2026-07-26 22:08:52 +09:00
parent e5419e4491
commit 57e369ddef
+2 -2
View File
@@ -20,7 +20,7 @@ use crate::{
EAFNOSUPPORT, EDOM, EFAULT, EINVAL, EMSGSIZE, ENOMEM, ENOSYS, ENOTSOCK, EOPNOTSUPP,
EPROTONOSUPPORT,
},
netinet_in::{in_addr, in6_addr, in_port_t, sockaddr_in, sockaddr_in6},
netinet_in::{in_addr, in_port_t, sockaddr_in, sockaddr_in6},
string::strnlen,
sys_select::timeval,
sys_socket::{
@@ -73,7 +73,7 @@ unsafe fn bind_or_connect(
}
let data = unsafe { &*address.cast::<sockaddr_in6>() };
let addr = unsafe { &data.sin6_addr.s6_addr };
let addr = &data.sin6_addr.s6_addr;
let port = in_port_t::from_be(data.sin6_port);
let scope = data.sin6_scope_id;