Merge "Stop exporting unwinder from arm32 libc.a"
diff --git a/libc/include/netinet/icmp6.h b/libc/include/netinet/icmp6.h
index 43ec521..2b237a8 100644
--- a/libc/include/netinet/icmp6.h
+++ b/libc/include/netinet/icmp6.h
@@ -280,6 +280,8 @@
 #define ND_OPT_ROUTE_INFO		24	/* RFC 4191 */
 #define ND_OPT_RDNSS			25	/* RFC 6016 */
 #define ND_OPT_DNSSL			31	/* RFC 6016 */
+#define ND_OPT_CAPTIVE_PORTAL		37	/* RFC 7710 */
+#define ND_OPT_PREF64			38	/* RFC-ietf-6man-ra-pref64-09 */
 
 struct nd_opt_route_info {	/* route info */
 	u_int8_t	nd_opt_rti_type;
@@ -335,6 +337,19 @@
 	/* followed by list of IP prefixes */
 } __packed;
 
+struct nd_opt_captive_portal {	/* CAPTIVE PORTAL option RFC 7710 */
+	u_int8_t	nd_opt_captive_portal_type;   // ND_OPT_CAPTIVE_PORTAL
+	u_int8_t	nd_opt_captive_portal_len;    // in 8 byte units
+	u_int8_t	nd_opt_captive_portal_uri[];  // 6 + n*8 bytes
+} __packed;
+
+struct nd_opt_pref64 {		/* PREF64 option RFC-ietf-6man-ra-pref64-09 */
+	u_int8_t	nd_opt_pref64_type;          // ND_OPT_PREF64
+	u_int8_t	nd_opt_pref64_len;           // 8 byte units, thus '2'
+	u_int16_t	nd_opt_pref64_lifetime_plc;  // net endian, 13 + 3 bits
+	u_int8_t	nd_opt_pref64_prefix[12];    // top 96 bits
+} __packed;
+
 /*
  * icmp6 namelookup
  */
diff --git a/tests/cfi_test.cpp b/tests/cfi_test.cpp
index e155e1a..792f917 100644
--- a/tests/cfi_test.cpp
+++ b/tests/cfi_test.cpp
@@ -18,6 +18,8 @@
 #include <gtest/gtest.h>
 #include <sys/stat.h>
 
+#include <vector>
+
 #include "BionicDeathTest.h"
 #include "gtest_globals.h"
 #include "utils.h"
@@ -35,6 +37,14 @@
 
 static void f() {}
 
+static void test_cfi_slowpath_with_alloc() {
+  std::vector<void*> allocs;
+  for (size_t i = 0; i < 1000; i++) {
+    allocs.push_back(malloc(4096));
+    __cfi_slowpath(46, allocs.back());
+  }
+}
+
 TEST(cfi_test, basic) {
 #if defined(__BIONIC__)
   void* handle;
@@ -88,10 +98,11 @@
   // CFI check for a stack address. This is always invalid and gets the process killed.
   EXPECT_DEATH(__cfi_slowpath(45, reinterpret_cast<void*>(&c)), "");
 
-  // CFI check for a heap address. This is always invalid and gets the process killed.
-  void* p = malloc(4096);
-  EXPECT_DEATH(__cfi_slowpath(46, p), "");
-  free(p);
+  // CFI check for a heap address.
+  // It's possible that this allocation could wind up in the same CFI granule as
+  // an unchecked library, which means the below might not crash. To force a
+  // crash keep allocating up to a max until there is a crash.
+  EXPECT_DEATH(test_cfi_slowpath_with_alloc(), "");
 
   // Check all the addresses.
   const size_t bss_size = 1024 * 1024;