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