From f4dca7be3b7bc181f1534be187428c5a52cb8c6a Mon Sep 17 00:00:00 2001
From: "Steinar H. Gunderson" <sesse@google.com>
Date: Mon, 20 Dec 2010 11:33:31 +0100
Subject: [PATCH] Backport (simple cherry-pick)
 64b6c43379dba176659bc1313b6bb488ac94cfd6 to gingerbread.

Add a new #define IN6_IS_ADDR_ULA, for testing for Universal Local IPv6 Unicast addresses (ULAs). These replace the old site-local IPv6 addresses.
---
 libc/include/netinet/in6.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libc/include/netinet/in6.h b/libc/include/netinet/in6.h
index 2f5fee116..efd5c0a41 100644
--- a/libc/include/netinet/in6.h
+++ b/libc/include/netinet/in6.h
@@ -60,6 +60,10 @@
 #define IN6_IS_ADDR_SITELOCAL(a)	\
 	(((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))
 
+/* RFC 4193. */
+#define IN6_IS_ADDR_ULA(a)	\
+	(((a)->s6_addr[0] & 0xfe) == 0xfc)
+
 #define IN6_IS_ADDR_MULTICAST(a)	\
 	(((__const uint8_t *) (a))[0] == 0xff)