Compare commits

...
Sign in to create a new pull request.

9 commits

Author SHA1 Message Date
Pavel Zhukov
63b85bfba7 Fix FD leak in confpars 2019-11-26 09:51:31 +01:00
Pavel Zhukov
e8f9a11f47 Reword -B option manpage 2019-11-11 10:18:13 +01:00
Pavel Zhukov
f4fadd1b4d Readd systemd patch (#1768604) 2019-11-07 15:03:58 +01:00
Pavel Zhukov
17d03279ac Readd systemd patch (#1768604) 2019-11-07 15:03:58 +01:00
Pavel Zhukov
1ec9b3d4d7 Rework patches. Add dhclient -B option description 2019-11-07 15:03:06 +01:00
Pavel Zhukov
47486d48b2 Revert "Make the dispatcher script actually executable"
This reverts commit 5e20bf9fe8.
2019-11-07 15:02:27 +01:00
Lubomir Rintel
d6955f4182 Make the dispatcher script actually executable 2019-11-07 15:02:27 +01:00
Lubomir Rintel
3c5f247ab6 Move the NetworkManager dispatcher script out of /etc
It's not user configuration and shouldn't ever have been there. Except for that
it used to be the only location NetworkManager looked into. With NetworkManager
1.20 that is no longer the case and the dispatcher scripts can be moved to
/usr/lib.
2019-11-07 15:02:27 +01:00
Pavel Zhukov
91f677e46b Readd systemd patch (#1768604) 2019-11-07 14:53:37 +01:00
28 changed files with 506 additions and 106 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>
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
---

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>
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
---

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>
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
---

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>
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)
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>
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
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>
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
---

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>
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
---

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>
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
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>
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
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>
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
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>
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
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>
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)
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>
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
---

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>
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
(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>
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
---

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>
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
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>
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
(#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>
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.
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>
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)
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>
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
---

View file

@ -1,15 +1,11 @@
From 1c7b876dc558774c40a2a28da53c19c65e123124 Mon Sep 17 00:00:00 2001
From: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu, 21 Feb 2019 10:44:06 +0100
Subject: [PATCH 21/21] Load leases DB in non-replay mode only
Cc: pzhukov@redhat.com
commit 50c2b3ba8ce030a47b55dd707bb8a6ab20444a05
Author: Pavel Zhukov <pzhukov@redhat.com>
Date: Thu Feb 21 10:44:06 2019 +0100
---
server/confpars.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
Load leases DB in non-replay mode only
diff --git a/server/confpars.c b/server/confpars.c
index 2743979..db21a0b 100644
index 2743979..6b61964 100644
--- a/server/confpars.c
+++ b/server/confpars.c
@@ -134,6 +134,11 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
@ -17,35 +13,38 @@ index 2743979..db21a0b 100644
cfile = (struct parse *)0;
#if defined (TRACING)
+ // No need to dmalloc huge memory region if we're not going to re-play
+ if (!trace_playback()){
+ if (!trace_record()){
+ status = new_parse(&cfile, file, NULL, 0, filename, 0);
+ goto noreplay;
+ };
flen = lseek (file, (off_t)0, SEEK_END);
if (flen < 0) {
boom:
@@ -171,9 +176,11 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
@@ -165,7 +170,6 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
if (result != ulen)
log_fatal ("%s: short read of %d bytes instead of %d.",
filename, ulen, result);
- close (file);
memfile:
/* If we're recording, write out the filename and file contents. */
if (trace_record ())
trace_write_packet (ttype, ulen + tflen + 1, dbuf, MDL);
status = new_parse(&cfile, -1, fbuf, ulen, filename, 0); /* XXX */
+ dfree(dbuf, MDL);
@@ -174,6 +178,9 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
#else
status = new_parse(&cfile, file, NULL, 0, filename, 0);
#endif
+ noreplay:
+ if (!trace_playback())
+ close (file);
if (status != ISC_R_SUCCESS || cfile == NULL)
return status;
@@ -182,9 +189,6 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
else
@@ -183,7 +190,8 @@ isc_result_t read_conf_file (const char *filename, struct group *group,
status = conf_file_subparse (cfile, group, group_type);
end_parse (&cfile);
-#if defined (TRACING)
#if defined (TRACING)
- dfree (dbuf, MDL);
-#endif
+ if (trace_record())
+ dfree (dbuf, MDL);
#endif
return status;
}
--
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
index 4e5546a..6085b8e 100644
index 9b65438..44d508a 100644
--- a/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:
state_reboot (client);
break;
@ -59,10 +72,10 @@ index 635c510..ec6c227 100644
typedef struct {
diff --git a/server/dhcpd.c b/server/dhcpd.c
index e06f6b4..778ef8d 100644
index 530a923..4aef16b 100644
--- a/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;

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
index 6f7ecf2..c7ef53c 100644
--- a/bind/bind-9.11.2-P1/lib/isc/include/isc/result.h
@ -179,3 +194,6 @@ index 5900846..1197337 100644
+
+};
+#endif
--
2.14.5

View file

@ -0,0 +1,24 @@
commit 6acfd3125546a0e5db8fae8a9964cd2f88bf68c0
Author: Pavel Zhukov <pzhukov@redhat.com>
Date: Tue Oct 22 16:28:04 2019 +0200
Add dhclient(5) -B option description
Bug-Url: https://bugzilla.redhat.com/1764088
diff --git a/client/dhclient.8 b/client/dhclient.8
index 0145b9f..5226de5 100644
--- a/client/dhclient.8
+++ b/client/dhclient.8
@@ -552,6 +552,11 @@ 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
+Always set the bootp broadcast flag in request packets, so that
+servers will always broadcast replies. 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

View file

@ -1,7 +1,7 @@
From 5c6204bab7279050b78b3d03d1211e9d13d3fd71 Mon Sep 17 00:00:00 2001
From 8d974fd1f667e1b957ad4092fe66a8bb94f5f8fd 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)
Date: Thu, 7 Nov 2019 14:47:45 +0100
Subject: [PATCH 1/1] Add missed sd notify patch to manage dhcpd with systemd
Cc: pzhukov@redhat.com
---
@ -63,7 +63,7 @@ index 7b4f4f1..9eb5bfd 100644
dispatch();
diff --git a/server/dhcpd.c b/server/dhcpd.c
index 530a923..e06f6b4 100644
index 4aef16b..778ef8d 100644
--- a/server/dhcpd.c
+++ b/server/dhcpd.c
@@ -60,6 +60,10 @@ gid_t set_gid = 0;

View file

@ -15,7 +15,8 @@
Summary: Dynamic host configuration protocol software
Name: dhcp
Version: 4.4.1
Release: 16%{?dist}
Release: 20%{?dist}
# NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to
# dcantrell maintaining the package) made incorrect use of the epoch and
# that's why it is at 12 now. It should have never been used, but it was.
@ -33,32 +34,33 @@ Source6: dhcpd.service
Source7: dhcpd6.service
Source8: dhcrelay.service
Patch1: 0001-change-bug-url.patch
Patch2: 0002-additional-dhclient-options.patch
Patch3: 0003-Handle-releasing-interfaces-requested-by-sbin-ifup.patch
Patch4: 0004-Support-unicast-BOOTP-for-IBM-pSeries-systems-and-ma.patch
Patch5: 0005-Change-default-requested-options.patch
Patch6: 0006-Various-man-page-only-fixes.patch
Patch7: 0007-Change-paths-to-conform-to-our-standards.patch
Patch8: 0008-Make-sure-all-open-file-descriptors-are-closed-on-ex.patch
Patch9: 0009-Fix-garbage-in-format-string-error.patch
Patch10: 0010-Handle-null-timeout.patch
Patch11: 0011-Drop-unnecessary-capabilities.patch
Patch12: 0012-RFC-3442-Classless-Static-Route-Option-for-DHCPv4-51.patch
Patch13: 0013-DHCPv6-over-PPP-support-626514.patch
Patch14: 0014-IPoIB-support-660681.patch
Patch15: 0015-Add-GUID-DUID-to-dhcpd-logs-1064416.patch
Patch16: 0016-Turn-on-creating-sending-of-DUID.patch
Patch17: 0017-Send-unicast-request-release-via-correct-interface.patch
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
Patch20: 0020-Discover-all-hwaddress-for-xid-uniqueness.patch
Patch21: 0021-Load-leases-DB-in-non-replay-mode-only.patch
Patch22: 0022-Backport-sd-notify-patch-for-systemd-support-1687040.patch
Patch23: 0023-Detect-system-time-jumps.patch
Patch24: 0024-bind-Detect-system-time-jumps.patch
Patch1 : 0001-change-bug-url.patch
Patch2 : 0002-additional-dhclient-options.patch
Patch3 : 0003-Handle-releasing-interfaces-requested-by-sbin-ifup.patch
Patch4 : 0004-Support-unicast-BOOTP-for-IBM-pSeries-systems-and-ma.patch
Patch5 : 0005-Change-default-requested-options.patch
Patch6 : 0006-Various-man-page-only-fixes.patch
Patch7 : 0007-Change-paths-to-conform-to-our-standards.patch
Patch8 : 0008-Make-sure-all-open-file-descriptors-are-closed-on-ex.patch
Patch9 : 0009-Fix-garbage-in-format-string-error.patch
Patch10 : 0010-Handle-null-timeout.patch
Patch11 : 0011-Drop-unnecessary-capabilities.patch
Patch12 : 0012-RFC-3442-Classless-Static-Route-Option-for-DHCPv4-51.patch
Patch13 : 0013-DHCPv6-over-PPP-support-626514.patch
Patch14 : 0014-IPoIB-support-660681.patch
Patch15 : 0015-Add-GUID-DUID-to-dhcpd-logs-1064416.patch
Patch16 : 0016-Turn-on-creating-sending-of-DUID.patch
Patch17 : 0017-Send-unicast-request-release-via-correct-interface.patch
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
Patch20 : 0020-Discover-all-hwaddress-for-xid-uniqueness.patch
Patch21 : 0021-Load-leases-DB-in-non-replay-mode-only.patch
Patch22 : 0022-dhclient-make-sure-link-local-address-is-ready-in-st.patch
Patch23 : 0023-option-97-pxe-client-id.patch
Patch24 : 0024-Detect-system-time-changes.patch
Patch25 : 0025-bind-Detect-system-time-changes.patch
Patch26 : 0026-Add-dhclient-5-B-option-description.patch
Patch27: 0027-Add-missed-sd-notify-patch-to-manage-dhcpd-with-syst.patch
BuildRequires: autoconf
@ -97,6 +99,8 @@ Requires(post): coreutils grep sed
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
# Old NetworkManager expects the dispatcher scripts in a different place
Conflicts: NetworkManager < 1.20
%description server
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
@ -144,6 +148,8 @@ Obsoletes: dhclient < %{epoch}:%{version}-%{release}
# dhclient-script requires:
Requires: coreutils gawk grep ipcalc iproute iputils sed systemd
Requires: %{name}-common = %{epoch}:%{version}-%{release}
# Old NetworkManager expects the dispatcher scripts in a different place
Conflicts: NetworkManager < 1.20
%description client
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
@ -280,9 +286,9 @@ install -p -m 0644 %{SOURCE2} .
mkdir -p %{buildroot}%{dhcpconfdir}/dhclient.d
# NetworkManager dispatcher script
mkdir -p %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d
install -p -m 0755 %{SOURCE3} %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d
install -p -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d
mkdir -p %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d
install -p -m 0755 %{SOURCE3} %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d
install -p -m 0644 %{SOURCE4} %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d
# pm-utils script to handle suspend/resume and dhclient leases
install -D -p -m 0755 %{SOURCE5} %{buildroot}%{_libdir}/pm-utils/sleep.d/56dhclient
@ -461,9 +467,9 @@ done
%config(noreplace) %{dhcpconfdir}/dhcpd6.conf
%dir %{_sysconfdir}/openldap/schema
%config(noreplace) %{_sysconfdir}/openldap/schema/dhcp.schema
%dir %{_sysconfdir}/NetworkManager
%dir %{_sysconfdir}/NetworkManager/dispatcher.d
%{_sysconfdir}/NetworkManager/dispatcher.d/12-dhcpd
%dir %{_prefix}/lib/NetworkManager
%dir %{_prefix}/lib/NetworkManager/dispatcher.d
%{_prefix}/lib/NetworkManager/dispatcher.d/12-dhcpd
%attr(0644,root,root) %{_unitdir}/dhcpd.service
%attr(0644,root,root) %{_unitdir}/dhcpd6.service
%{_sbindir}/dhcpd
@ -489,9 +495,9 @@ done
%attr(0750,root,root) %dir %{dhcpconfdir}
%dir %{dhcpconfdir}/dhclient.d
%dir %{_localstatedir}/lib/dhclient
%dir %{_sysconfdir}/NetworkManager
%dir %{_sysconfdir}/NetworkManager/dispatcher.d
%{_sysconfdir}/NetworkManager/dispatcher.d/11-dhclient
%dir %{_prefix}/lib/NetworkManager
%dir %{_prefix}/lib/NetworkManager/dispatcher.d
%{_prefix}/lib/NetworkManager/dispatcher.d/11-dhclient
%{_sbindir}/dhclient
%{_sbindir}/dhclient-script
%attr(0755,root,root) %{_libdir}/pm-utils/sleep.d/56dhclient
@ -524,6 +530,19 @@ done
%endif
%changelog
* Tue Nov 26 2019 Pavel Zhukov <pzhukov@redhat.com> - 12:4.4.1-20
- Fix FD leak in confparse
* Mon Nov 11 2019 Pavel Zhukov <pzhukov@redhat.com> - 12:4.4.1-19
- Reword -B option description
* Thu Nov 7 2019 Pavel Zhukov <pzhukov@redhat.com> - 12:4.4.1-18
- Readd sd-notify patch
* Thu Aug 22 2019 Lubomir Rintel <lkundrak@v3.sk> - 12:4.4.1-17
- Move the NetworkManager dispatcher script out of /etc
* Thu Jul 25 2019 Pavel Zhukov <pzhukov@redhat.com> - 12:4.4.1-16
- Split timers patch to bind and dhcp parts