This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
library/std/src/sys/unix/ext/net Expand file tree Collapse file tree 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;
55use crate :: mem:: { size_of, zeroed} ;
66use crate :: os:: unix:: io:: RawFd ;
77use crate :: path:: Path ;
8+ #[ cfg( target_os = "android" ) ]
9+ use crate :: ptr:: eq;
810use crate :: ptr:: read_unaligned;
911use crate :: slice:: from_raw_parts;
1012use crate :: sys:: net:: Socket ;
@@ -157,6 +159,13 @@ fn add_to_ancillary_data<T>(
157159 while !cmsg. is_null ( ) {
158160 previous_cmsg = cmsg;
159161 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+ }
160169 }
161170
162171 if previous_cmsg. is_null ( ) {
@@ -420,6 +429,16 @@ impl<'a> Iterator for Messages<'a> {
420429 } ;
421430
422431 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+
423442 self . current = Some ( cmsg) ;
424443 let ancillary_result = AncillaryData :: try_from_cmsghdr ( cmsg) ;
425444 Some ( ancillary_result)
You can’t perform that action at this time.
0 commit comments