busybox: squashed commit of merging cm-12.1

With fixes to LOCAL_C_INCLUDES for libsepol in M and fixed
some missing includes to enable building for 64 bit devices

Conflicts:
	Android.mk
	android/libc/arch-x86/syscalls/swapoff.S
	android/libc/arch-x86/syscalls/swapon.S
	android/libc/arch-x86/syscalls/sysinfo.S
	android/librpc/pmap_rmt.c
	android/reboot.c
	include-full/copy-current.sh
	include-minimal/copy-current.sh
	include/platform.h
	networking/interface.c
	networking/nslookup.c

Change-Id: If6092fa87f3d21190db1af4f70daa150eb462660
diff --git a/networking/interface.c b/networking/interface.c
index 00c27b9..8e95d94 100644
--- a/networking/interface.c
+++ b/networking/interface.c
@@ -54,8 +54,8 @@
 #define _PATH_PROCNET_DEV               "/proc/net/dev"
 #define _PATH_PROCNET_IFINET6           "/proc/net/if_inet6"
 
-#ifdef HAVE_AFINET6
-#ifndef _UAPI_IPV6_H
+#if defined(HAVE_AFINET6) && !defined(BIONIC_L)
+# ifndef _LINUX_IN6_H
 /*
  * This is from linux/include/net/ipv6.h
  */
@@ -64,7 +64,7 @@
 	uint32_t ifr6_prefixlen;
 	unsigned int ifr6_ifindex;
 };
-#endif
+# endif
 #endif /* HAVE_AFINET6 */
 
 /* Defines for glibc2.0 users. */
@@ -722,68 +722,15 @@
 	return buff;
 }
 
-static int FAST_FUNC ether_input(const char *bufp, struct sockaddr *sap);
-
 static const struct hwtype ether_hwtype = {
 	.name  = "ether",
 	.title = "Ethernet",
 	.type  = ARPHRD_ETHER,
 	.alen  = ETH_ALEN,
 	.print = ether_print,
-	.input = ether_input
+	.input = in_ether
 };
 
-static unsigned hexchar2int(char c)
-{
-	if (isdigit(c))
-		return c - '0';
-	c &= ~0x20; /* a -> A */
-	if ((unsigned)(c - 'A') <= 5)
-		return c - ('A' - 10);
-	return ~0U;
-}
-
-/* Input an Ethernet address and convert to binary. */
-static int FAST_FUNC ether_input(const char *bufp, struct sockaddr *sap)
-{
-	unsigned char *ptr;
-	char c;
-	int i;
-	unsigned val;
-
-	sap->sa_family = ether_hwtype.type;
-	ptr = (unsigned char*) sap->sa_data;
-
-	i = 0;
-	while ((*bufp != '\0') && (i < ETH_ALEN)) {
-		val = hexchar2int(*bufp++) * 0x10;
-		if (val > 0xff) {
-			errno = EINVAL;
-			return -1;
-		}
-		c = *bufp;
-		if (c == ':' || c == 0)
-			val >>= 4;
-		else {
-			val |= hexchar2int(c);
-			if (val > 0xff) {
-				errno = EINVAL;
-				return -1;
-			}
-		}
-		if (c != 0)
-			bufp++;
-		*ptr++ = (unsigned char) val;
-		i++;
-
-		/* We might get a semicolon here - not required. */
-		if (*bufp == ':') {
-			bufp++;
-		}
-	}
-	return 0;
-}
-
 static const struct hwtype ppp_hwtype = {
 	.name =		"ppp",
 	.title =	"Point-to-Point Protocol",
@@ -927,7 +874,7 @@
 static void ife_print6(struct interface *ptr)
 {
 	FILE *f;
-	char addr6[40], devname[20];
+	char addr6[40], devname[21];
 	struct sockaddr_in6 sap;
 	int plen, scope, dad_status, if_idx;
 	char addr6p[8][5];