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/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c
index da76bbe..1058b5a 100644
--- a/networking/libiproute/ipaddress.c
+++ b/networking/libiproute/ipaddress.c
@@ -627,10 +627,12 @@
 	req.ifa.ifa_family = preferred_family;
 
 	while (*argv) {
-		const smalluint arg = index_in_strings(option, *argv);
-		if (arg <= 1) { /* peer, remote */
+		unsigned arg = index_in_strings(option, *argv);
+		/* if search fails, "local" is assumed */
+		if ((int)arg >= 0)
 			NEXT_ARG();
 
+		if (arg <= 1) { /* peer, remote */
 			if (peer_len) {
 				duparg("peer", *argv);
 			}
@@ -643,7 +645,6 @@
 			req.ifa.ifa_prefixlen = peer.bitlen;
 		} else if (arg <= 3) { /* broadcast, brd */
 			inet_prefix addr;
-			NEXT_ARG();
 			if (brd_len) {
 				duparg("broadcast", *argv);
 			}
@@ -660,7 +661,6 @@
 			}
 		} else if (arg == 4) { /* anycast */
 			inet_prefix addr;
-			NEXT_ARG();
 			if (any_len) {
 				duparg("anycast", *argv);
 			}
@@ -672,22 +672,18 @@
 			any_len = addr.bytelen;
 		} else if (arg == 5) { /* scope */
 			uint32_t scope = 0;
-			NEXT_ARG();
 			if (rtnl_rtscope_a2n(&scope, *argv)) {
 				invarg(*argv, "scope");
 			}
 			req.ifa.ifa_scope = scope;
 			scoped = 1;
 		} else if (arg == 6) { /* dev */
-			NEXT_ARG();
 			d = *argv;
 		} else if (arg == 7) { /* label */
-			NEXT_ARG();
 			l = *argv;
 			addattr_l(&req.n, sizeof(req), IFA_LABEL, l, strlen(l) + 1);
 		} else {
-			if (arg == 8) /* local */
-				NEXT_ARG();
+			/* local (specified or assumed) */
 			if (local_len) {
 				duparg2("local", *argv);
 			}
@@ -724,7 +720,7 @@
 		}
 		brd = peer;
 		if (brd.bitlen <= 30) {
-			for (i=31; i>=brd.bitlen; i--) {
+			for (i = 31; i >= brd.bitlen; i--) {
 				if (brd_len == -1)
 					brd.data[0] |= htonl(1<<(31-i));
 				else
@@ -754,11 +750,11 @@
 {
 	static const char commands[] ALIGN1 =
 		"add\0""delete\0""list\0""show\0""lst\0""flush\0";
-	smalluint cmd = 2;
+	int cmd = 2;
 	if (*argv) {
 		cmd = index_in_substrings(commands, *argv);
-		if (cmd > 5)
-			bb_error_msg_and_die(bb_msg_invalid_arg, *argv, applet_name);
+		if (cmd < 0)
+			invarg(*argv, applet_name);
 		argv++;
 		if (cmd <= 1)
 			return ipaddr_modify((cmd == 0) ? RTM_NEWADDR : RTM_DELADDR, argv);