fix iOS setsockopt invalid params
@@ -37,8 +37,10 @@ impl super::UdpExt for UdpSocket {
let addr = self.local_addr()?;
- // macos doesn't support IP_RECVTOS on dual-stack sockets :(
- if addr.is_ipv4() || (!cfg!(target_os = "macos") && !self.only_v6()?) {
+ // macos and ios do not support IP_RECVTOS on dual-stack sockets :(
+ if addr.is_ipv4()
+ || ((!cfg!(any(target_os = "macos", target_os = "ios"))) && !self.only_v6()?)
+ {
let on: libc::c_int = 1;
let rc = unsafe {
libc::setsockopt(
