8173a6
diff -up dhcp-4.3.4/client/dhclient.c.preinit6s dhcp-4.3.4/client/dhclient.c
8173a6
--- dhcp-4.3.4/client/dhclient.c.preinit6s	2016-04-29 13:15:10.361379493 +0200
8173a6
+++ dhcp-4.3.4/client/dhclient.c	2016-04-29 13:17:43.622415423 +0200
8173a6
@@ -812,6 +812,12 @@ main(int argc, char **argv) {
59c88c
 
59c88c
 	inaddr_any.s_addr = INADDR_ANY;
59c88c
 
59c88c
+	/* Discover all the network interfaces. */
59c88c
+	discover_interfaces(DISCOVER_UNCONFIGURED);
59c88c
+
59c88c
+	/* Parse the dhclient.conf file. */
59c88c
+	read_client_conf();
59c88c
+
59c88c
 	/* Stateless special case. */
59c88c
 	if (stateless) {
59c88c
 		if (release_mode || (wanted_ia_na > 0) ||
8173a6
@@ -828,12 +834,6 @@ main(int argc, char **argv) {
59c88c
 		return 0;
59c88c
 	}
59c88c
 
59c88c
-	/* Discover all the network interfaces. */
59c88c
-	discover_interfaces(DISCOVER_UNCONFIGURED);
59c88c
-
59c88c
-	/* Parse the dhclient.conf file. */
59c88c
-	read_client_conf();
59c88c
-
59c88c
 	/* Parse any extra command line configuration arguments: */
59c88c
 	if ((dhcp_client_identifier_arg != NULL) && (*dhcp_client_identifier_arg != '\0')) {
59c88c
 		arg_conf_len = asprintf(&arg_conf, "send dhcp-client-identifier \"%s\";", dhcp_client_identifier_arg);
8173a6
@@ -1288,20 +1288,30 @@ void run_stateless(int exit_mode, u_int1
8173a6
 	IGNORE_UNUSED(port);
8173a6
 #endif
8173a6
 
59c88c
-	/* Discover the network interface. */
59c88c
-	discover_interfaces(DISCOVER_REQUESTED);
59c88c
+	struct interface_info *ip;
59c88c
 
59c88c
 	if (!interfaces)
8173a6
 		usage("No interfaces available for stateless command: %s", "-S");
59c88c
 
59c88c
-	/* Parse the dhclient.conf file. */
8173a6
 #ifdef DHCP4o6
8173a6
 	if (dhcpv4_over_dhcpv6) {
8173a6
 		/* Mark we want to request IRT too! */
8173a6
 		dhcpv4_over_dhcpv6++;
8173a6
 	}
8173a6
 #endif
59c88c
-	read_client_conf();
8173a6
+
59c88c
+	for (ip = interfaces; ip; ip = ip->next) {
59c88c
+		if ((interfaces_requested > 0) &&
59c88c
+		    ((ip->flags & (INTERFACE_REQUESTED |
59c88c
+				   INTERFACE_AUTOMATIC)) !=
59c88c
+		     INTERFACE_REQUESTED))
59c88c
+			continue;
15e541
+		script_init(ip->client, "PREINIT6", NULL);
59c88c
+		script_go(ip->client);
59c88c
+	}
59c88c
+
59c88c
+	/* Discover the network interface. */
59c88c
+	discover_interfaces(DISCOVER_REQUESTED);
59c88c
 
59c88c
 	/* Parse the lease database. */
59c88c
 	read_client_leases();