am 3586ee30: (-s ours) am 17fdc0de: (-s ours) dhcp: Remove errant extra ref (DO NOT MERGE) [bug: 4174566]

* commit '3586ee3039bf5b36a7a80210698eceb3ab4f9be5':
  dhcp: Remove errant extra ref (DO NOT MERGE) [bug: 4174566]
diff --git a/dhcpcd.c b/dhcpcd.c
index e984ceb..c229baf 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1898,9 +1898,14 @@
 		char pidpropname[PROPERTY_KEY_MAX];
 		char pidpropval[PROPERTY_VALUE_MAX];
 
+		if (optind != argc - 1) {
+			syslog(LOG_ERR, "Android requires an interface");
+			exit(EXIT_FAILURE);
+		}
+
 		if (snprintf(pidpropname,
 			     sizeof(pidpropname),
-			     "dhcp.%s.pid", iface->name) >= PROPERTY_KEY_MAX)
+			     "dhcp.%s.pid", argv[optind]) >= PROPERTY_KEY_MAX)
 			exit(EXIT_FAILURE);
 		property_get(pidpropname, pidpropval, NULL);
 		if (strlen(pidpropval) == 0)
@@ -1978,9 +1983,14 @@
 		if (set_cloexec(pidfd) == -1)
 			exit(EXIT_FAILURE);
 #ifdef ANDROID
+		if (optind != argc - 1) {
+			syslog(LOG_ERR, "Android requires an interface");
+			exit(EXIT_FAILURE);
+		}
+
 		if (snprintf(pidpropname,
 			     sizeof(pidpropname),
-			     "dhcp.%s.pid", iface->name) >= PROPERTY_KEY_MAX)
+			     "dhcp.%s.pid", argv[optind]) >= PROPERTY_KEY_MAX)
 			exit(EXIT_FAILURE);
 		if (snprintf(pidpropval, sizeof(pidpropval), "%d", getpid()) >= PROPERTY_VALUE_MAX)
 			exit(EXIT_FAILURE);