@@ -15,7 +15,7 @@ use std::net::{SocketAddr};
15
15
#[ cfg( unix) ]
16
16
use std:: ffi:: { CString } ;
17
17
use std:: io:: { self , ErrorKind , Read , Write } ;
18
- #[ cfg( target_os = "macos" ) ]
18
+ #[ cfg( any ( target_os = "macos" , target_os = "ios" ) ) ]
19
19
use std:: num:: NonZeroU32 ;
20
20
use std:: mem:: { forget, MaybeUninit } ;
21
21
use std:: os:: raw:: c_int;
@@ -127,10 +127,10 @@ impl Remote for RemoteResource {
127
127
if let Some ( bind_device) = config. bind_device {
128
128
let device = CString :: new ( bind_device) ?;
129
129
130
- #[ cfg( not( target_os = "macos" ) ) ]
130
+ #[ cfg( all ( not( target_os = "macos" ) , not ( target_os = "ios" ) ) ) ]
131
131
socket. bind_device ( Some ( device. as_bytes ( ) ) ) ?;
132
132
133
- #[ cfg( target_os = "macos" ) ]
133
+ #[ cfg( any ( target_os = "macos" , target_os = "ios" ) ) ]
134
134
match NonZeroU32 :: new ( unsafe { libc:: if_nametoindex ( device. as_ptr ( ) ) } ) {
135
135
Some ( index) => socket. bind_device_by_index_v4 ( Some ( index) ) ?,
136
136
None => {
@@ -283,10 +283,10 @@ impl Local for LocalResource {
283
283
if let Some ( bind_device) = config. bind_device {
284
284
let device = CString :: new ( bind_device) ?;
285
285
286
- #[ cfg( not( target_os = "macos" ) ) ]
286
+ #[ cfg( all ( not( target_os = "macos" ) , not ( target_os = "ios" ) ) ) ]
287
287
socket. bind_device ( Some ( device. as_bytes ( ) ) ) ?;
288
288
289
- #[ cfg( target_os = "macos" ) ]
289
+ #[ cfg( any ( target_os = "macos" , target_os = "ios" ) ) ]
290
290
match NonZeroU32 :: new ( unsafe { libc:: if_nametoindex ( device. as_ptr ( ) ) } ) {
291
291
Some ( index) => socket. bind_device_by_index_v4 ( Some ( index) ) ?,
292
292
None => {
0 commit comments