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