about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLinkTed <link.ted@mailbox.org>2020-11-26 18:54:13 +0100
committerLinkTed <link.ted@mailbox.org>2020-11-26 18:54:13 +0100
commit8983752c12c65e598dff704502ad1b0334d1daaa (patch)
tree4fb9d6d3786d8ae330bc38689942e23ed0390624
parent9b9dd4aeea858fb2249adc9421ab156a78e84b8b (diff)
downloadrust-8983752c12c65e598dff704502ad1b0334d1daaa.tar.gz
rust-8983752c12c65e598dff704502ad1b0334d1daaa.zip
Add comment for the previous android bug fix
-rw-r--r--library/std/src/sys/unix/ext/net/ancillary.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/sys/unix/ext/net/ancillary.rs b/library/std/src/sys/unix/ext/net/ancillary.rs
index a94456b4e7a..2c91ba70dd0 100644
--- a/library/std/src/sys/unix/ext/net/ancillary.rs
+++ b/library/std/src/sys/unix/ext/net/ancillary.rs
@@ -160,6 +160,8 @@ fn add_to_ancillary_data<T>(
             previous_cmsg = cmsg;
             cmsg = libc::CMSG_NXTHDR(&msg, cmsg);
             cfg_if::cfg_if! {
+                // Android return the same pointer if it is the last cmsg.
+                // Therefore, check it if the previous pointer is the same as the current one.
                 if #[cfg(target_os = "android")] {
                     if cmsg == previous_cmsg {
                         break;
@@ -430,6 +432,8 @@ impl<'a> Iterator for Messages<'a> {
 
             let cmsg = cmsg.as_ref()?;
             cfg_if::cfg_if! {
+                // Android return the same pointer if it is the last cmsg.
+                // Therefore, check it if the previous pointer is the same as the current one.
                 if #[cfg(target_os = "android")] {
                     if let Some(current) = self.current {
                         if eq(current, cmsg) {