]>
Commit | Line | Data |
---|---|---|
d8feb2d7 SS |
1 | diff -up dhcp-4.3.4/client/dhclient.c.preinit6s dhcp-4.3.4/client/dhclient.c |
2 | --- dhcp-4.3.4/client/dhclient.c.preinit6s 2016-04-29 13:15:10.361379493 +0200 | |
3 | +++ dhcp-4.3.4/client/dhclient.c 2016-04-29 13:17:43.622415423 +0200 | |
4 | @@ -812,6 +812,12 @@ main(int argc, char **argv) { | |
5 | ||
6 | inaddr_any.s_addr = INADDR_ANY; | |
7 | ||
8 | + /* Discover all the network interfaces. */ | |
9 | + discover_interfaces(DISCOVER_UNCONFIGURED); | |
10 | + | |
11 | + /* Parse the dhclient.conf file. */ | |
12 | + read_client_conf(); | |
13 | + | |
14 | /* Stateless special case. */ | |
15 | if (stateless) { | |
16 | if (release_mode || (wanted_ia_na > 0) || | |
17 | @@ -828,12 +834,6 @@ main(int argc, char **argv) { | |
18 | return 0; | |
19 | } | |
20 | ||
21 | - /* Discover all the network interfaces. */ | |
22 | - discover_interfaces(DISCOVER_UNCONFIGURED); | |
23 | - | |
24 | - /* Parse the dhclient.conf file. */ | |
25 | - read_client_conf(); | |
26 | - | |
27 | /* Parse any extra command line configuration arguments: */ | |
28 | if ((dhcp_client_identifier_arg != NULL) && (*dhcp_client_identifier_arg != '\0')) { | |
29 | arg_conf_len = asprintf(&arg_conf, "send dhcp-client-identifier \"%s\";", dhcp_client_identifier_arg); | |
30 | @@ -1288,20 +1288,30 @@ void run_stateless(int exit_mode, u_int1 | |
31 | IGNORE_UNUSED(port); | |
32 | #endif | |
33 | ||
34 | - /* Discover the network interface. */ | |
35 | - discover_interfaces(DISCOVER_REQUESTED); | |
36 | + struct interface_info *ip; | |
37 | ||
38 | if (!interfaces) | |
39 | usage("No interfaces available for stateless command: %s", "-S"); | |
40 | ||
41 | - /* Parse the dhclient.conf file. */ | |
42 | #ifdef DHCP4o6 | |
43 | if (dhcpv4_over_dhcpv6) { | |
44 | /* Mark we want to request IRT too! */ | |
45 | dhcpv4_over_dhcpv6++; | |
46 | } | |
47 | #endif | |
48 | - read_client_conf(); | |
49 | + | |
50 | + for (ip = interfaces; ip; ip = ip->next) { | |
51 | + if ((interfaces_requested > 0) && | |
52 | + ((ip->flags & (INTERFACE_REQUESTED | | |
53 | + INTERFACE_AUTOMATIC)) != | |
54 | + INTERFACE_REQUESTED)) | |
55 | + continue; | |
56 | + script_init(ip->client, "PREINIT6", NULL); | |
57 | + script_go(ip->client); | |
58 | + } | |
59 | + | |
60 | + /* Discover the network interface. */ | |
61 | + discover_interfaces(DISCOVER_REQUESTED); | |
62 | ||
63 | /* Parse the lease database. */ | |
64 | read_client_leases(); |