Rework patches. Add dhclient -B option description

This commit is contained in:
Pavel Zhukov 2019-10-22 16:58:01 +02:00
parent 6f96789cfe
commit 9c49c9e94d
28 changed files with 466 additions and 167 deletions

View File

@ -1,7 +1,7 @@
From 31ef6eadb15c3773b81256a8617eccc7657fd2fd Mon Sep 17 00:00:00 2001 From 23dfbc560028bf7429196db1a3826f8b80c19d3e Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:09:57 +0100 Date: Thu, 21 Feb 2019 10:09:57 +0100
Subject: [PATCH 01/21] change bug url Subject: [PATCH 01/26] change bug url
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com
--- ---

View File

@ -1,7 +1,7 @@
From 3a86bcb58a7c081df22b6f55e973d5e3c99065d8 Mon Sep 17 00:00:00 2001 From a26161b0fd45cdbeed3038ac63ff04e3b727248f Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:19:47 +0100 Date: Thu, 21 Feb 2019 10:19:47 +0100
Subject: [PATCH 02/21] additional dhclient options Subject: [PATCH 02/26] additional dhclient options
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com
--- ---

View File

@ -1,7 +1,7 @@
From 692fd8b16ef6f12a57596351e930c65c68597bac Mon Sep 17 00:00:00 2001 From af504e99abde04b881768d18eaa0054b36b16303 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:21:14 +0100 Date: Thu, 21 Feb 2019 10:21:14 +0100
Subject: [PATCH 03/21] Handle releasing interfaces requested by /sbin/ifup Subject: [PATCH 03/26] Handle releasing interfaces requested by /sbin/ifup
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com
--- ---

View File

@ -1,7 +1,7 @@
From 9dc17d6086bf140efda84ce434664b60ce2191a1 Mon Sep 17 00:00:00 2001 From 7e8cc8388ac31c5c2b1a423c6b2da0491b19f6f9 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:22:41 +0100 Date: Thu, 21 Feb 2019 10:22:41 +0100
Subject: [PATCH 04/21] Support unicast BOOTP for IBM pSeries systems (and Subject: [PATCH 04/26] Support unicast BOOTP for IBM pSeries systems (and
maybe others) maybe others)
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com

View File

@ -1,7 +1,7 @@
From ac21c8b966620cbe79be3508c024ae30f93d6266 Mon Sep 17 00:00:00 2001 From a2a3554ff9e05d1a8e2c8aa843f1b6a33fce87e3 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:24:24 +0100 Date: Thu, 21 Feb 2019 10:24:24 +0100
Subject: [PATCH 05/21] Change default requested options Subject: [PATCH 05/26] Change default requested options
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com
Add NIS domain, NIS servers, NTP servers, interface-mtu and domain-search Add NIS domain, NIS servers, NTP servers, interface-mtu and domain-search

View File

@ -1,7 +1,7 @@
From dd3053e6f45ac1f149869b7ded3f539d6c046114 Mon Sep 17 00:00:00 2001 From 846779467f7393b19e8d206405116e1e26e16efc Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:25:53 +0100 Date: Thu, 21 Feb 2019 10:25:53 +0100
Subject: [PATCH 06/21] Various man-page-only fixes Subject: [PATCH 06/26] Various man-page-only fixes
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com
--- ---

View File

@ -1,7 +1,7 @@
From bf4e3f1d181b5b4e6225fe5726c02420157433cc Mon Sep 17 00:00:00 2001 From ac65289663532db0bc1de449ca2a0eb4c8c2ca6f Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:26:34 +0100 Date: Thu, 21 Feb 2019 10:26:34 +0100
Subject: [PATCH 07/21] Change paths to conform to our standards Subject: [PATCH 07/26] Change paths to conform to our standards
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com
--- ---

View File

@ -1,7 +1,7 @@
From 26d34bc8e55c39ef84d580b6453c65b5cbeab8ff Mon Sep 17 00:00:00 2001 From d2da34706f140101c34f6a9806c258411806a939 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:27:18 +0100 Date: Thu, 21 Feb 2019 10:27:18 +0100
Subject: [PATCH 08/21] Make sure all open file descriptors are closed-on-exec Subject: [PATCH 08/26] Make sure all open file descriptors are closed-on-exec
for SELinux for SELinux
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com

View File

@ -1,7 +1,7 @@
From 9ffd73d22b1337aeedef751afd03822cc0a15014 Mon Sep 17 00:00:00 2001 From a0a2186ce52a31357d4eb3c32d7d6887e4603814 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:28:13 +0100 Date: Thu, 21 Feb 2019 10:28:13 +0100
Subject: [PATCH 09/21] Fix 'garbage in format string' error Subject: [PATCH 09/26] Fix 'garbage in format string' error
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com
RHBZ: 450042 RHBZ: 450042

View File

@ -1,7 +1,7 @@
From e269e137c3b7d25a2d089be508e6769731618d54 Mon Sep 17 00:00:00 2001 From ed7610cdb2e8ebdbaee618e477879e7e008d4f29 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:29:08 +0100 Date: Thu, 21 Feb 2019 10:29:08 +0100
Subject: [PATCH 10/21] Handle null timeout Subject: [PATCH 10/26] Handle null timeout
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com
Handle cases in add_timeout() where the function is called with a NULL Handle cases in add_timeout() where the function is called with a NULL

View File

@ -1,7 +1,7 @@
From 291f738f341a78f8c7974a7603d1a2eaa01ebacc Mon Sep 17 00:00:00 2001 From 3b37f4b7bb3a17f8bd655be919915a1912062ea6 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:30:28 +0100 Date: Thu, 21 Feb 2019 10:30:28 +0100
Subject: [PATCH 11/21] Drop unnecessary capabilities Subject: [PATCH 11/26] Drop unnecessary capabilities
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com
dhclient (#517649, #546765), dhcpd/dhcrelay (#699713) dhclient (#517649, #546765), dhcpd/dhcrelay (#699713)

View File

@ -1,7 +1,7 @@
From 2756fcc3f88c27d0e12e72dbdd2906fbf45f2362 Mon Sep 17 00:00:00 2001 From 01b1dcfef129a4eccfaf0f63a216774019f82dca Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:32:35 +0100 Date: Thu, 21 Feb 2019 10:32:35 +0100
Subject: [PATCH 12/21] RFC 3442 - Classless Static Route Option for DHCPv4 Subject: [PATCH 12/26] RFC 3442 - Classless Static Route Option for DHCPv4
(#516325) (#516325)
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com

View File

@ -1,7 +1,7 @@
From 43332b29f0c8fef3ddd225e31f5f2b4ff8273b36 Mon Sep 17 00:00:00 2001 From 234747fbfd6c6429619ba843713d5b39fb4a513d Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:33:06 +0100 Date: Thu, 21 Feb 2019 10:33:06 +0100
Subject: [PATCH 13/21] DHCPv6 over PPP support (#626514) Subject: [PATCH 13/26] DHCPv6 over PPP support (#626514)
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com
--- ---

View File

@ -1,7 +1,7 @@
From de8468cf16c0fa9d01412446fcf1d44ccd0fd411 Mon Sep 17 00:00:00 2001 From 6d74c2d0ceadef2eb1c43c2da47f1d5b732adf8c Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:34:21 +0100 Date: Thu, 21 Feb 2019 10:34:21 +0100
Subject: [PATCH 14/21] IPoIB support (#660681) Subject: [PATCH 14/26] IPoIB support (#660681)
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com
(Submitted to dhcp-bugs@isc.org - [ISC-Bugs #24249]) (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #24249])

View File

@ -1,7 +1,7 @@
From 7ac7d0b00874ee996c7ee75a595c029759368aad Mon Sep 17 00:00:00 2001 From 3d3e442ed1316930a5360e4d5a56b46a42a29419 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:35:47 +0100 Date: Thu, 21 Feb 2019 10:35:47 +0100
Subject: [PATCH 15/21] Add GUID/DUID to dhcpd logs (#1064416) Subject: [PATCH 15/26] Add GUID/DUID to dhcpd logs (#1064416)
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com
--- ---

View File

@ -1,7 +1,7 @@
From 1f0473939bcb17095bbef48cd9a81105a3de9846 Mon Sep 17 00:00:00 2001 From 2f6b827e89305adcff45288c632785ac054adb8e Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:36:30 +0100 Date: Thu, 21 Feb 2019 10:36:30 +0100
Subject: [PATCH 16/21] Turn on creating/sending of DUID Subject: [PATCH 16/26] Turn on creating/sending of DUID
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com
as client identifier with DHCPv4 clients (#560361c#40, rfc4361) as client identifier with DHCPv4 clients (#560361c#40, rfc4361)

View File

@ -1,7 +1,7 @@
From 8a2b491f79aab1f04feac89586dfab1e55b47adb Mon Sep 17 00:00:00 2001 From 193c4d7631fd623efa601f52fdab6018bf8be771 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:39:36 +0100 Date: Thu, 21 Feb 2019 10:39:36 +0100
Subject: [PATCH 17/21] Send unicast request/release via correct interface Subject: [PATCH 17/26] Send unicast request/release via correct interface
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com
(#800561, #1177351) (#800561, #1177351)

View File

@ -1,7 +1,7 @@
From 588ead2d9a9cfe70f14569a8e950c6c42f15c1e3 Mon Sep 17 00:00:00 2001 From 2277d041692b8ebdf6b86d41e3a0bc0381cd1e47 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:40:51 +0100 Date: Thu, 21 Feb 2019 10:40:51 +0100
Subject: [PATCH 18/21] No subnet declaration for <iface>' should be info, not Subject: [PATCH 18/26] No subnet declaration for <iface>' should be info, not
error. error.
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com

View File

@ -1,7 +1,7 @@
From 07b333c48a2fc99d7d502a0c88907b38f61c6230 Mon Sep 17 00:00:00 2001 From 6ea56e988df1da51f7d0bdd8984b38e40102c17b Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:41:14 +0100 Date: Thu, 21 Feb 2019 10:41:14 +0100
Subject: [PATCH 19/21] dhclient: write DUID_LLT even in stateless mode Subject: [PATCH 19/26] dhclient: write DUID_LLT even in stateless mode
(#1156356) (#1156356)
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com

View File

@ -1,7 +1,7 @@
From f1467835402eee90a350a952f1a411f37475a9df Mon Sep 17 00:00:00 2001 From 01ce61b8a0331a2f068ca2191bfb897b505c1b9d Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:42:50 +0100 Date: Thu, 21 Feb 2019 10:42:50 +0100
Subject: [PATCH 20/21] Discover all hwaddress for xid uniqueness Subject: [PATCH 20/26] Discover all hwaddress for xid uniqueness
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com
--- ---

View File

@ -1,7 +1,7 @@
From 1c7b876dc558774c40a2a28da53c19c65e123124 Mon Sep 17 00:00:00 2001 From e2de752020ea51428bbaaa7358f08632c42aa89d Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com> From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:44:06 +0100 Date: Thu, 21 Feb 2019 10:44:06 +0100
Subject: [PATCH 21/21] Load leases DB in non-replay mode only Subject: [PATCH 21/26] Load leases DB in non-replay mode only
Cc: pzhukov@redhat.com Cc: pzhukov@redhat.com
--- ---

View File

@ -1,97 +0,0 @@
From 5c6204bab7279050b78b3d03d1211e9d13d3fd71 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com>
Date: Wed, 27 Mar 2019 09:59:20 +0100
Subject: [PATCH] Backport sd-notify patch for systemd support (#1687040)
Cc: pzhukov@redhat.com
---
configure.ac | 11 +++++++++++
relay/dhcrelay.c | 12 ++++++++++++
server/dhcpd.c | 12 ++++++++++++
3 files changed, 35 insertions(+)
diff --git a/configure.ac b/configure.ac
index 15fc0d7..0c08000 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1014,6 +1014,17 @@ if test x$ldap = xyes || test x$ldapcrypto = xyes || test x$ldap_gssapi = xyes;
AC_SUBST(LDAP_CFLAGS, [$LDAP_CFLAGS])
fi
+AC_ARG_WITH(systemd,
+ AC_HELP_STRING([--with-systemd],
+ [enable sending status notifications to systemd daemon (default is no)]),
+ [systemd=$withval],
+ [systemd=no])
+
+if test x$systemd = xyes ; then
+ AC_CHECK_LIB(systemd, sd_notifyf, ,
+ AC_MSG_FAILURE([*** systemd library not present - do you need to install systemd-libs package?]))
+fi
+
# Append selected warning levels to CFLAGS before substitution (but after
# AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[]) & etc).
CFLAGS="$CFLAGS $STD_CWARNINGS"
diff --git a/relay/dhcrelay.c b/relay/dhcrelay.c
index 7b4f4f1..9eb5bfd 100644
--- a/relay/dhcrelay.c
+++ b/relay/dhcrelay.c
@@ -37,6 +37,10 @@
int keep_capabilities = 0;
#endif
+#ifdef HAVE_LIBSYSTEMD
+#include <systemd/sd-daemon.h>
+#endif
+
TIME default_lease_time = 43200; /* 12 hours... */
TIME max_lease_time = 86400; /* 24 hours... */
struct tree_cache *global_options[256];
@@ -845,6 +849,14 @@ main(int argc, char **argv) {
}
#endif
+#ifdef HAVE_LIBSYSTEMD
+ /* We are ready to process incomming packets. Let's notify systemd */
+ sd_notifyf(0, "READY=1\n"
+ "STATUS=Dispatching packets...\n"
+ "MAINPID=%lu",
+ (unsigned long) getpid());
+#endif
+
/* Start dispatching packets and timeouts... */
dispatch();
diff --git a/server/dhcpd.c b/server/dhcpd.c
index 530a923..e06f6b4 100644
--- a/server/dhcpd.c
+++ b/server/dhcpd.c
@@ -60,6 +60,10 @@ gid_t set_gid = 0;
struct class unknown_class;
struct class known_class;
+#ifdef HAVE_LIBSYSTEMD
+#include <systemd/sd-daemon.h>
+#endif
+
struct iaddr server_identifier;
int server_identifier_matched;
@@ -1057,6 +1061,14 @@ main(int argc, char **argv) {
/* Log that we are about to start working */
log_info("Server starting service.");
+#ifdef HAVE_LIBSYSTEMD
+ /* We are ready to process incomming packets. Let's notify systemd */
+ sd_notifyf(0, "READY=1\n"
+ "STATUS=Dispatching packets...\n"
+ "MAINPID=%lu",
+ (unsigned long) getpid());
+#endif
+
/*
* Receive packets and dispatch them...
* dispatch() will never return.
--
2.14.5

View File

@ -0,0 +1,80 @@
From 9975d198a2c02e32c31c3e0f43d2aa79dfa7f508 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 28 Feb 2019 15:30:21 +0100
Subject: [PATCH 22/26] dhclient: make sure link-local address is ready in
stateless mode
Cc: pzhukov@redhat.com
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
index 4e5546a..9b65438 100644
--- a/client/dhclient.c
+++ b/client/dhclient.c
@@ -937,6 +937,12 @@ main(int argc, char **argv) {
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) ||
@@ -953,12 +959,6 @@ main(int argc, char **argv) {
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);
@@ -1413,20 +1413,30 @@ void run_stateless(int exit_mode, u_int16_t port)
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();
--
2.14.5

View File

@ -0,0 +1,247 @@
From 6fd7894ea57791c8eee16c21d19da34b909e016e Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 28 Feb 2019 16:40:38 +0100
Subject: [PATCH 23/26] option 97 - pxe-client-id
Cc: pzhukov@redhat.com
Bug-url: https://bugzilla.redhat.com/1058674
ISC-Bugs #38110
---
common/options.c | 27 ++++++++++++++++++++-------
common/tables.c | 3 ++-
includes/dhcp.h | 1 +
server/dhcp.c | 19 +++++++++++++++++++
server/dhcpd.conf.5 | 9 ++++++---
server/dhcpleasequery.c | 18 +++++++++++++++---
server/failover.c | 3 +++
server/mdb.c | 5 +++--
8 files changed, 69 insertions(+), 16 deletions(-)
diff --git a/common/options.c b/common/options.c
index 3034cf0..686dd12 100644
--- a/common/options.c
+++ b/common/options.c
@@ -4465,13 +4465,26 @@ int validate_packet(struct packet *packet)
"a future version of ISC DHCP will reject this");
}
} else {
- /*
- * If hlen is 0 we don't have any identifier, we warn the user
- * but continue processing the packet as we can.
- */
- if (packet->raw->hlen == 0) {
- log_debug("Received DHCPv4 packet without client-id"
- " option and empty hlen field.");
+ oc = lookup_option (&dhcp_universe, packet->options,
+ DHO_PXE_CLIENT_ID);
+ if (oc) {
+ /* Let's check if pxe-client-id is sane */
+ if ((oc->data.len < 2) ||
+ (oc->data.data[0] == '\0' &&
+ oc->data.len != 17)) {
+ log_debug("Dropped DHCPv4 packet with wrong "
+ "(len == %d) pxe-client-id", oc->data.len);
+ return (0);
+ }
+ } else {
+ /*
+ * If hlen is 0 we don't have any identifier, we warn the user
+ * but continue processing the packet as we can.
+ */
+ if (packet->raw->hlen == 0) {
+ log_debug("Received DHCPv4 packet without client-id"
+ " option and empty hlen field.");
+ }
}
}
diff --git a/common/tables.c b/common/tables.c
index f1be07d..4419220 100644
--- a/common/tables.c
+++ b/common/tables.c
@@ -196,8 +196,9 @@ static struct option dhcp_options[] = {
/* Defined by RFC 4578 */
{ "pxe-system-type", "Sa", &dhcp_universe, 93, 1 },
{ "pxe-interface-id", "BBB", &dhcp_universe, 94, 1 },
- { "pxe-client-id", "BX", &dhcp_universe, 97, 1 },
#endif
+ { "pxe-client-id", "BX", &dhcp_universe, 97, 1 },
+
{ "uap-servers", "t", &dhcp_universe, 98, 1 },
#if defined(RFC4776_OPTIONS)
{ "geoconf-civic", "X", &dhcp_universe, 99, 1 },
diff --git a/includes/dhcp.h b/includes/dhcp.h
index 4cc547a..4eb9791 100644
--- a/includes/dhcp.h
+++ b/includes/dhcp.h
@@ -158,6 +158,7 @@ struct dhcp_packet {
#define DHO_AUTHENTICATE 90 /* RFC3118, was 210 */
#define DHO_CLIENT_LAST_TRANSACTION_TIME 91
#define DHO_ASSOCIATED_IP 92
+#define DHO_PXE_CLIENT_ID 97 /* RFC4578 */
#define DHO_SUBNET_SELECTION 118 /* RFC3011! */
#define DHO_DOMAIN_SEARCH 119 /* RFC3397 */
#define DHO_CLASSLESS_STATIC_ROUTES 121 /* RFC3442 */
diff --git a/server/dhcp.c b/server/dhcp.c
index 0582c4c..4e86262 100644
--- a/server/dhcp.c
+++ b/server/dhcp.c
@@ -222,6 +222,10 @@ dhcp (struct packet *packet) {
if (lease -> uid_len) {
oc = lookup_option (&dhcp_universe, packet -> options,
DHO_DHCP_CLIENT_IDENTIFIER);
+ if (!oc)
+ oc = lookup_option (&dhcp_universe,
+ packet -> options,
+ DHO_PXE_CLIENT_ID);
if (!oc)
goto nolease;
@@ -820,6 +824,9 @@ void dhcprelease (packet, ms_nulltp)
oc = lookup_option (&dhcp_universe, packet -> options,
DHO_DHCP_CLIENT_IDENTIFIER);
+ if (!oc)
+ oc = lookup_option (&dhcp_universe, packet -> options,
+ DHO_PXE_CLIENT_ID);
memset (&data, 0, sizeof data);
if (oc &&
evaluate_option_cache (&data, packet, (struct lease *)0,
@@ -1331,6 +1338,9 @@ void dhcpinform (packet, ms_nulltp)
*/
oc = lookup_option(&dhcp_universe, packet->options,
DHO_DHCP_CLIENT_IDENTIFIER);
+ if (!oc)
+ oc = lookup_option (&dhcp_universe, packet -> options,
+ DHO_PXE_CLIENT_ID);
memset(&d1, 0, sizeof(d1));
if (oc &&
evaluate_option_cache(&d1, packet, NULL, NULL,
@@ -2441,6 +2451,9 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
can be used. */
oc = lookup_option (&dhcp_universe, packet -> options,
DHO_DHCP_CLIENT_IDENTIFIER);
+ if (!oc)
+ oc = lookup_option (&dhcp_universe, packet -> options,
+ DHO_PXE_CLIENT_ID);
if (oc &&
evaluate_option_cache (&d1, packet, lease,
(struct client_state *)0,
@@ -3033,6 +3046,9 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
/* Record the uid, if given... */
oc = lookup_option (&dhcp_universe, packet -> options,
DHO_DHCP_CLIENT_IDENTIFIER);
+ if (!oc)
+ oc = lookup_option (&dhcp_universe, packet -> options,
+ DHO_PXE_CLIENT_ID);
if (oc &&
evaluate_option_cache(&d1, packet, lease, NULL,
packet->options, state->options,
@@ -4150,6 +4166,9 @@ int find_lease (struct lease **lp,
specified unique client identifier. */
oc = lookup_option (&dhcp_universe, packet -> options,
DHO_DHCP_CLIENT_IDENTIFIER);
+ if (!oc)
+ oc = lookup_option (&dhcp_universe, packet -> options,
+ DHO_PXE_CLIENT_ID);
memset (&client_identifier, 0, sizeof client_identifier);
if (oc &&
evaluate_option_cache (&client_identifier,
diff --git a/server/dhcpd.conf.5 b/server/dhcpd.conf.5
index 89b5540..4751a8b 100644
--- a/server/dhcpd.conf.5
+++ b/server/dhcpd.conf.5
@@ -1664,10 +1664,12 @@ should be a name identifying the host. If a \fIhostname\fR option is
not specified for the host, \fIhostname\fR is used.
.PP
\fIHost\fR declarations are matched to actual DHCP or BOOTP clients
-by matching the \fRdhcp-client-identifier\fR option specified in the
+by matching the \fIdhcp-client-identifier\fR or \fIpxe-client-id\fR
+options specified in the
\fIhost\fR declaration to the one supplied by the client, or, if the
\fIhost\fR declaration or the client does not provide a
-\fRdhcp-client-identifier\fR option, by matching the \fIhardware\fR
+\fIdhcp-client-identifier\fR or \fIpxe-client-id\fR options,
+by matching the \fIhardware\fR
parameter in the \fIhost\fR declaration to the network hardware
address supplied by the client. BOOTP clients do not normally
provide a \fIdhcp-client-identifier\fR, so the hardware address must
@@ -1679,7 +1681,8 @@ to identify hosts.
.PP
Please be aware that
.B only
-the \fIdhcp-client-identifier\fR option and the hardware address can be
+the \fIdhcp-client-identifier\fR and \fIpxe-client-id\fR
+options and the hardware address can be
used to match a host declaration, or the \fIhost-identifier option\fR
parameter for DHCPv6 servers. For example, it is not possible to
match a host declaration to a \fIhost-name\fR option. This is
diff --git a/server/dhcpleasequery.c b/server/dhcpleasequery.c
index 7be0788..2fee698 100644
--- a/server/dhcpleasequery.c
+++ b/server/dhcpleasequery.c
@@ -276,7 +276,7 @@ dhcpleasequery(struct packet *packet, int ms_nulltp) {
*/
memset(&uid, 0, sizeof(uid));
- if (get_option(&uid,
+ i = get_option(&uid,
&dhcp_universe,
packet,
NULL,
@@ -286,8 +286,20 @@ dhcpleasequery(struct packet *packet, int ms_nulltp) {
packet->options,
&global_scope,
DHO_DHCP_CLIENT_IDENTIFIER,
- MDL)) {
-
+ MDL);
+ if (!i)
+ i = get_option(&uid,
+ &dhcp_universe,
+ packet,
+ NULL,
+ NULL,
+ packet->options,
+ NULL,
+ packet->options,
+ &global_scope,
+ DHO_PXE_CLIENT_ID,
+ MDL);
+ if (i) {
snprintf(dbg_info,
sizeof(dbg_info),
"client-id %s",
diff --git a/server/failover.c b/server/failover.c
index 72f7b00..40fa691 100644
--- a/server/failover.c
+++ b/server/failover.c
@@ -5988,6 +5988,9 @@ int load_balance_mine (struct packet *packet, dhcp_failover_state_t *state)
oc = lookup_option(&dhcp_universe, packet->options,
DHO_DHCP_CLIENT_IDENTIFIER);
+ if (!oc)
+ oc = lookup_option(&dhcp_universe, packet -> options,
+ DHO_PXE_CLIENT_ID);
memset(&ds, 0, sizeof ds);
if (oc &&
evaluate_option_cache(&ds, packet, NULL, NULL,
diff --git a/server/mdb.c b/server/mdb.c
index 052df67..8851366 100644
--- a/server/mdb.c
+++ b/server/mdb.c
@@ -129,8 +129,9 @@ static int find_uid_statement (struct executable_statement *esp,
esp -> data.option &&
(esp -> data.option -> option -> universe ==
&dhcp_universe) &&
- (esp -> data.option -> option -> code ==
- DHO_DHCP_CLIENT_IDENTIFIER)) {
+ ((esp -> data.option -> option -> code ==
+ DHO_DHCP_CLIENT_IDENTIFIER) ||
+ (esp -> data.option -> option -> code == DHO_PXE_CLIENT_ID))) {
if (condp) {
log_error ("dhcp client identifier may not be %s",
"specified conditionally.");
--
2.14.5

View File

@ -1,8 +1,21 @@
From 41c6032ace65119e6a400365f7e90283c930afd4 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com>
Date: Tue, 22 Oct 2019 16:23:01 +0200
Subject: [PATCH 24/26] Detect system time changes
Cc: pzhukov@redhat.com
---
client/dhclient.c | 6 ++++++
common/dispatch.c | 11 ++++++++++-
includes/dhcpd.h | 3 ++-
server/dhcpd.c | 6 ++++++
4 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/client/dhclient.c b/client/dhclient.c diff --git a/client/dhclient.c b/client/dhclient.c
index 4e5546a..6085b8e 100644 index 9b65438..44d508a 100644
--- a/client/dhclient.c --- a/client/dhclient.c
+++ b/client/dhclient.c +++ b/client/dhclient.c
@@ -5398,6 +5398,12 @@ isc_result_t dhcp_set_control_state (control_object_state_t oldstate, @@ -5408,6 +5408,12 @@ isc_result_t dhcp_set_control_state (control_object_state_t oldstate,
case server_awaken: case server_awaken:
state_reboot (client); state_reboot (client);
break; break;
@ -59,10 +72,10 @@ index 635c510..ec6c227 100644
typedef struct { typedef struct {
diff --git a/server/dhcpd.c b/server/dhcpd.c diff --git a/server/dhcpd.c b/server/dhcpd.c
index e06f6b4..778ef8d 100644 index 530a923..4aef16b 100644
--- a/server/dhcpd.c --- a/server/dhcpd.c
+++ b/server/dhcpd.c +++ b/server/dhcpd.c
@@ -1779,6 +1779,12 @@ isc_result_t dhcp_set_control_state (control_object_state_t oldstate, @@ -1767,6 +1767,12 @@ isc_result_t dhcp_set_control_state (control_object_state_t oldstate,
{ {
struct timeval tv; struct timeval tv;

View File

@ -1,3 +1,18 @@
From 5917ba14ccf7c7cc2eadf8b6cc666f8be4d2d2a4 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com>
Date: Tue, 22 Oct 2019 16:23:24 +0200
Subject: [PATCH 25/26] bind: Detect system time changes
Cc: pzhukov@redhat.com
---
bind/bind-9.11.2-P1/lib/isc/include/isc/result.h | 4 +--
bind/bind-9.11.2-P1/lib/isc/include/isc/util.h | 4 +++
bind/bind-9.11.2-P1/lib/isc/result.c | 2 ++
bind/bind-9.11.2-P1/lib/isc/unix/app.c | 41 ++++++++++++++++++++--
.../bind-9.11.2-P1/lib/isc/unix/include/isc/time.h | 20 +++++++++++
bind/bind-9.11.2-P1/lib/isc/unix/time.c | 22 ++++++++++++
6 files changed, 89 insertions(+), 4 deletions(-)
diff --git a/bind/bind-9.11.2-P1/lib/isc/include/isc/result.h b/bind/bind-9.11.2-P1/lib/isc/include/isc/result.h diff --git a/bind/bind-9.11.2-P1/lib/isc/include/isc/result.h b/bind/bind-9.11.2-P1/lib/isc/include/isc/result.h
index 6f7ecf2..c7ef53c 100644 index 6f7ecf2..c7ef53c 100644
--- a/bind/bind-9.11.2-P1/lib/isc/include/isc/result.h --- a/bind/bind-9.11.2-P1/lib/isc/include/isc/result.h
@ -179,3 +194,6 @@ index 5900846..1197337 100644
+ +
+}; +};
+#endif +#endif
--
2.14.5

View File

@ -0,0 +1,33 @@
From 7cae2da1c50c6680b92ca58eb03f9d59315010ba Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com>
Date: Tue, 22 Oct 2019 16:28:04 +0200
Subject: [PATCH 26/26] Add dhclient(5) -B option description
Cc: pzhukov@redhat.com
Bug-Url: https://bugzilla.redhat.com/1764088
---
client/dhclient.8 | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/client/dhclient.8 b/client/dhclient.8
index 0145b9f..b466ac7 100644
--- a/client/dhclient.8
+++ b/client/dhclient.8
@@ -552,6 +552,14 @@ Path to the network configuration script invoked by
when it gets a lease. If unspecified, the default
.B CLIENTBINDIR/dhclient-script
is used. See \fBdhclient-script(8)\fR for a description of this file.
+.TP
+.BI \-B
+statement instructs dhclient to always set the bootp broadcast flag in
+request packets, so that servers will always broadcast replies.
+This is equivalent to supplying the dhclient -B argument, and has
+the same effect as specifying 'always-broadcast' in the server's dhcpd.conf.
+This option is provided as an extension to enable dhclient to work
+on IBM s390 Linux guests.
.PP
.SH PORTS
During operations the client may use multiple UDP ports
--
2.14.5

View File

@ -33,6 +33,10 @@ Source6: dhcpd.service
Source7: dhcpd6.service Source7: dhcpd6.service
Source8: dhcrelay.service Source8: dhcrelay.service
Patch1 : 0001-change-bug-url.patch Patch1 : 0001-change-bug-url.patch
Patch2 : 0002-additional-dhclient-options.patch Patch2 : 0002-additional-dhclient-options.patch
Patch3 : 0003-Handle-releasing-interfaces-requested-by-sbin-ifup.patch Patch3 : 0003-Handle-releasing-interfaces-requested-by-sbin-ifup.patch
@ -54,10 +58,11 @@ Patch18: 0018-No-subnet-declaration-for-iface-should-be-info-not-e.patch
Patch19 : 0019-dhclient-write-DUID_LLT-even-in-stateless-mode-11563.patch Patch19 : 0019-dhclient-write-DUID_LLT-even-in-stateless-mode-11563.patch
Patch20 : 0020-Discover-all-hwaddress-for-xid-uniqueness.patch Patch20 : 0020-Discover-all-hwaddress-for-xid-uniqueness.patch
Patch21 : 0021-Load-leases-DB-in-non-replay-mode-only.patch Patch21 : 0021-Load-leases-DB-in-non-replay-mode-only.patch
Patch22: 0022-Backport-sd-notify-patch-for-systemd-support-1687040.patch Patch22 : 0022-dhclient-make-sure-link-local-address-is-ready-in-st.patch
Patch23 : 0023-option-97-pxe-client-id.patch
Patch23: 0023-Detect-system-time-jumps.patch Patch24 : 0024-Detect-system-time-changes.patch
Patch24: 0024-bind-Detect-system-time-jumps.patch Patch25 : 0025-bind-Detect-system-time-changes.patch
Patch26 : 0026-Add-dhclient-5-B-option-description.patch