|
|
f9ed25 |
From 9975d198a2c02e32c31c3e0f43d2aa79dfa7f508 Mon Sep 17 00:00:00 2001
|
|
|
f9ed25 |
From: Pavel Zhukov <pzhukov@redhat.com>
|
|
|
f9ed25 |
Date: Thu, 28 Feb 2019 15:30:21 +0100
|
|
|
f9ed25 |
Subject: [PATCH 22/26] dhclient: make sure link-local address is ready in
|
|
|
f9ed25 |
stateless mode
|
|
|
f9ed25 |
Cc: pzhukov@redhat.com
|
|
|
f9ed25 |
|
|
|
f9ed25 |
Bug-url: https://bugzilla.redhat.com/1263466
|
|
|
f9ed25 |
---
|
|
|
f9ed25 |
client/dhclient.c | 30 ++++++++++++++++++++----------
|
|
|
f9ed25 |
1 file changed, 20 insertions(+), 10 deletions(-)
|
|
|
f9ed25 |
|
|
|
f9ed25 |
diff --git a/client/dhclient.c b/client/dhclient.c
|
|
|
f9ed25 |
index 4e5546a..9b65438 100644
|
|
|
f9ed25 |
--- a/client/dhclient.c
|
|
|
f9ed25 |
+++ b/client/dhclient.c
|
|
|
f9ed25 |
@@ -937,6 +937,12 @@ main(int argc, char **argv) {
|
|
|
f9ed25 |
|
|
|
f9ed25 |
inaddr_any.s_addr = INADDR_ANY;
|
|
|
f9ed25 |
|
|
|
f9ed25 |
+ /* Discover all the network interfaces. */
|
|
|
f9ed25 |
+ discover_interfaces(DISCOVER_UNCONFIGURED);
|
|
|
f9ed25 |
+
|
|
|
f9ed25 |
+ /* Parse the dhclient.conf file. */
|
|
|
f9ed25 |
+ read_client_conf();
|
|
|
f9ed25 |
+
|
|
|
f9ed25 |
/* Stateless special case. */
|
|
|
f9ed25 |
if (stateless) {
|
|
|
f9ed25 |
if (release_mode || (wanted_ia_na > 0) ||
|
|
|
f9ed25 |
@@ -953,12 +959,6 @@ main(int argc, char **argv) {
|
|
|
f9ed25 |
finish(0);
|
|
|
f9ed25 |
}
|
|
|
f9ed25 |
|
|
|
f9ed25 |
- /* Discover all the network interfaces. */
|
|
|
f9ed25 |
- discover_interfaces(DISCOVER_UNCONFIGURED);
|
|
|
f9ed25 |
-
|
|
|
f9ed25 |
- /* Parse the dhclient.conf file. */
|
|
|
f9ed25 |
- read_client_conf();
|
|
|
f9ed25 |
-
|
|
|
f9ed25 |
/* Parse any extra command line configuration arguments: */
|
|
|
f9ed25 |
if ((dhcp_client_identifier_arg != NULL) && (*dhcp_client_identifier_arg != '\0')) {
|
|
|
f9ed25 |
arg_conf_len = asprintf(&arg_conf, "send dhcp-client-identifier \"%s\";", dhcp_client_identifier_arg);
|
|
|
f9ed25 |
@@ -1413,20 +1413,30 @@ void run_stateless(int exit_mode, u_int16_t port)
|
|
|
f9ed25 |
IGNORE_UNUSED(port);
|
|
|
f9ed25 |
#endif
|
|
|
f9ed25 |
|
|
|
f9ed25 |
- /* Discover the network interface. */
|
|
|
f9ed25 |
- discover_interfaces(DISCOVER_REQUESTED);
|
|
|
f9ed25 |
+ struct interface_info *ip;
|
|
|
f9ed25 |
|
|
|
f9ed25 |
if (!interfaces)
|
|
|
f9ed25 |
usage("No interfaces available for stateless command: %s", "-S");
|
|
|
f9ed25 |
|
|
|
f9ed25 |
- /* Parse the dhclient.conf file. */
|
|
|
f9ed25 |
#ifdef DHCP4o6
|
|
|
f9ed25 |
if (dhcpv4_over_dhcpv6) {
|
|
|
f9ed25 |
/* Mark we want to request IRT too! */
|
|
|
f9ed25 |
dhcpv4_over_dhcpv6++;
|
|
|
f9ed25 |
}
|
|
|
f9ed25 |
#endif
|
|
|
f9ed25 |
- read_client_conf();
|
|
|
f9ed25 |
+
|
|
|
f9ed25 |
+ for (ip = interfaces; ip; ip = ip->next) {
|
|
|
f9ed25 |
+ if ((interfaces_requested > 0) &&
|
|
|
f9ed25 |
+ ((ip->flags & (INTERFACE_REQUESTED |
|
|
|
f9ed25 |
+ INTERFACE_AUTOMATIC)) !=
|
|
|
f9ed25 |
+ INTERFACE_REQUESTED))
|
|
|
f9ed25 |
+ continue;
|
|
|
f9ed25 |
+ script_init(ip->client, "PREINIT6", NULL);
|
|
|
f9ed25 |
+ script_go(ip->client);
|
|
|
f9ed25 |
+ }
|
|
|
f9ed25 |
+
|
|
|
f9ed25 |
+ /* Discover the network interface. */
|
|
|
f9ed25 |
+ discover_interfaces(DISCOVER_REQUESTED);
|
|
|
f9ed25 |
|
|
|
f9ed25 |
/* Parse the lease database. */
|
|
|
f9ed25 |
read_client_leases();
|
|
|
f9ed25 |
--
|
|
|
f9ed25 |
2.14.5
|
|
|
f9ed25 |
|