Blame SOURCES/dhcp-dhclient-preinit6s.patch

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