File tree 1 file changed +19
-0
lines changed
library/std/src/sys/unix/ext/net
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ use crate::marker::PhantomData;
5
5
use crate :: mem:: { size_of, zeroed} ;
6
6
use crate :: os:: unix:: io:: RawFd ;
7
7
use crate :: path:: Path ;
8
+ #[ cfg( target_os = "android" ) ]
9
+ use crate :: ptr:: eq;
8
10
use crate :: ptr:: read_unaligned;
9
11
use crate :: slice:: from_raw_parts;
10
12
use crate :: sys:: net:: Socket ;
@@ -157,6 +159,13 @@ fn add_to_ancillary_data<T>(
157
159
while !cmsg. is_null ( ) {
158
160
previous_cmsg = cmsg;
159
161
cmsg = libc:: CMSG_NXTHDR ( & msg, cmsg) ;
162
+ cfg_if:: cfg_if! {
163
+ if #[ cfg( target_os = "android" ) ] {
164
+ if cmsg == previous_cmsg {
165
+ break ;
166
+ }
167
+ }
168
+ }
160
169
}
161
170
162
171
if previous_cmsg. is_null ( ) {
@@ -420,6 +429,16 @@ impl<'a> Iterator for Messages<'a> {
420
429
} ;
421
430
422
431
let cmsg = cmsg. as_ref ( ) ?;
432
+ cfg_if:: cfg_if! {
433
+ if #[ cfg( target_os = "android" ) ] {
434
+ if let Some ( current) = self . current {
435
+ if eq( current, cmsg) {
436
+ return None ;
437
+ }
438
+ }
439
+ }
440
+ }
441
+
423
442
self . current = Some ( cmsg) ;
424
443
let ancillary_result = AncillaryData :: try_from_cmsghdr ( cmsg) ;
425
444
Some ( ancillary_result)
You can’t perform that action at this time.
0 commit comments