From 91f677e46ba0c2cc6db237d466c9c7b59cead6bb Mon Sep 17 00:00:00 2001 From: Pavel Zhukov Date: Thu, 7 Nov 2019 14:50:40 +0100 Subject: [PATCH 1/9] Readd systemd patch (#1768604) --- ...tify-patch-to-manage-dhcpd-with-syst.patch | 97 +++++++++++++++++++ dhcp.spec | 58 ++++++----- 2 files changed, 130 insertions(+), 25 deletions(-) create mode 100644 0027-Add-missed-sd-notify-patch-to-manage-dhcpd-with-syst.patch diff --git a/0027-Add-missed-sd-notify-patch-to-manage-dhcpd-with-syst.patch b/0027-Add-missed-sd-notify-patch-to-manage-dhcpd-with-syst.patch new file mode 100644 index 0000000..cde51de --- /dev/null +++ b/0027-Add-missed-sd-notify-patch-to-manage-dhcpd-with-syst.patch @@ -0,0 +1,97 @@ +From 8d974fd1f667e1b957ad4092fe66a8bb94f5f8fd Mon Sep 17 00:00:00 2001 +From: Pavel Zhukov +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 + +--- + 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 ++#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 4aef16b..778ef8d 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 ++#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 + diff --git a/dhcp.spec b/dhcp.spec index bc73e58..e18c795 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -15,7 +15,9 @@ Summary: Dynamic host configuration protocol software Name: dhcp Version: 4.4.1 -Release: 16%{?dist} + +Release: 17%{?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,31 +35,34 @@ 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 +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 -Patch23: 0023-Detect-system-time-jumps.patch -Patch24: 0024-bind-Detect-system-time-jumps.patch @@ -524,6 +529,9 @@ done %endif %changelog +* Thu Nov 7 2019 Pavel Zhukov - 12:4.4.1-17 +- Readd sd-notify patch + * Thu Jul 25 2019 Pavel Zhukov - 12:4.4.1-16 - Split timers patch to bind and dhcp parts From 3c5f247ab60cfd10accf9964492b5aaa6992d3f7 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Thu, 22 Aug 2019 17:47:21 +0200 Subject: [PATCH 2/9] 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. --- dhcp.spec | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/dhcp.spec b/dhcp.spec index e18c795..dbb19b6 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -15,8 +15,7 @@ Summary: Dynamic host configuration protocol software Name: dhcp Version: 4.4.1 - -Release: 17%{?dist} +Release: 18%{?dist} # NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to # dcantrell maintaining the package) made incorrect use of the epoch and @@ -102,6 +101,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 @@ -149,6 +150,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 @@ -285,9 +288,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 @@ -466,9 +469,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 @@ -494,9 +497,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 @@ -532,6 +535,9 @@ done * Thu Nov 7 2019 Pavel Zhukov - 12:4.4.1-17 - Readd sd-notify patch +* Thu Aug 22 2019 Lubomir Rintel - 12:4.4.1-17 +- Move the NetworkManager dispatcher script out of /etc + * Thu Jul 25 2019 Pavel Zhukov - 12:4.4.1-16 - Split timers patch to bind and dhcp parts From d6955f4182901669d0ec3e62b9ab831c45eb7303 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Fri, 23 Aug 2019 08:15:31 +0200 Subject: [PATCH 3/9] Make the dispatcher script actually executable --- dhcp.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dhcp.spec b/dhcp.spec index dbb19b6..21223fd 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -290,7 +290,7 @@ mkdir -p %{buildroot}%{dhcpconfdir}/dhclient.d # NetworkManager dispatcher script 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 +install -p -m 0755 %{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 @@ -537,6 +537,7 @@ done * Thu Aug 22 2019 Lubomir Rintel - 12:4.4.1-17 - Move the NetworkManager dispatcher script out of /etc +- Make the dispatcher script actually executable * Thu Jul 25 2019 Pavel Zhukov - 12:4.4.1-16 - Split timers patch to bind and dhcp parts From 47486d48b2d939aeb69a3d7f4c2eee7fc75e3f03 Mon Sep 17 00:00:00 2001 From: Pavel Zhukov Date: Mon, 7 Oct 2019 11:04:10 +0200 Subject: [PATCH 4/9] Revert "Make the dispatcher script actually executable" This reverts commit 5e20bf9fe8e13c4a95fb6a76e9df0ecc6ecccbee. --- dhcp.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dhcp.spec b/dhcp.spec index 21223fd..dbb19b6 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -290,7 +290,7 @@ mkdir -p %{buildroot}%{dhcpconfdir}/dhclient.d # NetworkManager dispatcher script mkdir -p %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d install -p -m 0755 %{SOURCE3} %{buildroot}%{_prefix}/lib/NetworkManager/dispatcher.d -install -p -m 0755 %{SOURCE4} %{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 @@ -537,7 +537,6 @@ done * Thu Aug 22 2019 Lubomir Rintel - 12:4.4.1-17 - Move the NetworkManager dispatcher script out of /etc -- Make the dispatcher script actually executable * Thu Jul 25 2019 Pavel Zhukov - 12:4.4.1-16 - Split timers patch to bind and dhcp parts From 1ec9b3d4d78c22dce82e3f11da061bf181962034 Mon Sep 17 00:00:00 2001 From: Pavel Zhukov Date: Tue, 22 Oct 2019 16:58:01 +0200 Subject: [PATCH 5/9] Rework patches. Add dhclient -B option description --- 0001-change-bug-url.patch | 4 +- 0002-additional-dhclient-options.patch | 4 +- ...ng-interfaces-requested-by-sbin-ifup.patch | 4 +- ...BOOTP-for-IBM-pSeries-systems-and-ma.patch | 4 +- 0005-Change-default-requested-options.patch | 4 +- 0006-Various-man-page-only-fixes.patch | 4 +- ...ge-paths-to-conform-to-our-standards.patch | 4 +- ...en-file-descriptors-are-closed-on-ex.patch | 4 +- 0009-Fix-garbage-in-format-string-error.patch | 4 +- 0010-Handle-null-timeout.patch | 4 +- 0011-Drop-unnecessary-capabilities.patch | 4 +- ...ss-Static-Route-Option-for-DHCPv4-51.patch | 4 +- 0013-DHCPv6-over-PPP-support-626514.patch | 4 +- 0014-IPoIB-support-660681.patch | 4 +- ...-Add-GUID-DUID-to-dhcpd-logs-1064416.patch | 4 +- 0016-Turn-on-creating-sending-of-DUID.patch | 4 +- ...equest-release-via-correct-interface.patch | 4 +- ...ation-for-iface-should-be-info-not-e.patch | 4 +- ...UID_LLT-even-in-stateless-mode-11563.patch | 4 +- ...ver-all-hwaddress-for-xid-uniqueness.patch | 4 +- ...ad-leases-DB-in-non-replay-mode-only.patch | 4 +- ...fy-patch-for-systemd-support-1687040.patch | 97 ------- ...re-link-local-address-is-ready-in-st.patch | 80 ++++++ 0023-option-97-pxe-client-id.patch | 247 ++++++++++++++++++ ...h => 0024-Detect-system-time-changes.patch | 21 +- ...0025-bind-Detect-system-time-changes.patch | 18 ++ ...-Add-dhclient-5-B-option-description.patch | 33 +++ dhcp.spec | 2 - 28 files changed, 437 insertions(+), 145 deletions(-) delete mode 100644 0022-Backport-sd-notify-patch-for-systemd-support-1687040.patch create mode 100644 0022-dhclient-make-sure-link-local-address-is-ready-in-st.patch create mode 100644 0023-option-97-pxe-client-id.patch rename 0023-Detect-system-time-jumps.patch => 0024-Detect-system-time-changes.patch (78%) rename 0024-bind-Detect-system-time-jumps.patch => 0025-bind-Detect-system-time-changes.patch (88%) create mode 100644 0026-Add-dhclient-5-B-option-description.patch diff --git a/0001-change-bug-url.patch b/0001-change-bug-url.patch index 150a3b2..b6afa57 100644 --- a/0001-change-bug-url.patch +++ b/0001-change-bug-url.patch @@ -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 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 --- diff --git a/0002-additional-dhclient-options.patch b/0002-additional-dhclient-options.patch index e112130..d700c00 100644 --- a/0002-additional-dhclient-options.patch +++ b/0002-additional-dhclient-options.patch @@ -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 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 --- diff --git a/0003-Handle-releasing-interfaces-requested-by-sbin-ifup.patch b/0003-Handle-releasing-interfaces-requested-by-sbin-ifup.patch index 294b7fe..2953c0f 100644 --- a/0003-Handle-releasing-interfaces-requested-by-sbin-ifup.patch +++ b/0003-Handle-releasing-interfaces-requested-by-sbin-ifup.patch @@ -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 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 --- diff --git a/0004-Support-unicast-BOOTP-for-IBM-pSeries-systems-and-ma.patch b/0004-Support-unicast-BOOTP-for-IBM-pSeries-systems-and-ma.patch index e379480..7f414a3 100644 --- a/0004-Support-unicast-BOOTP-for-IBM-pSeries-systems-and-ma.patch +++ b/0004-Support-unicast-BOOTP-for-IBM-pSeries-systems-and-ma.patch @@ -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 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 diff --git a/0005-Change-default-requested-options.patch b/0005-Change-default-requested-options.patch index 89118b1..34ff7b5 100644 --- a/0005-Change-default-requested-options.patch +++ b/0005-Change-default-requested-options.patch @@ -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 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 diff --git a/0006-Various-man-page-only-fixes.patch b/0006-Various-man-page-only-fixes.patch index 286dde1..a98783c 100644 --- a/0006-Various-man-page-only-fixes.patch +++ b/0006-Various-man-page-only-fixes.patch @@ -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 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 --- diff --git a/0007-Change-paths-to-conform-to-our-standards.patch b/0007-Change-paths-to-conform-to-our-standards.patch index fb3348c..87c4f8c 100644 --- a/0007-Change-paths-to-conform-to-our-standards.patch +++ b/0007-Change-paths-to-conform-to-our-standards.patch @@ -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 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 --- diff --git a/0008-Make-sure-all-open-file-descriptors-are-closed-on-ex.patch b/0008-Make-sure-all-open-file-descriptors-are-closed-on-ex.patch index 9759055..8294563 100644 --- a/0008-Make-sure-all-open-file-descriptors-are-closed-on-ex.patch +++ b/0008-Make-sure-all-open-file-descriptors-are-closed-on-ex.patch @@ -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 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 diff --git a/0009-Fix-garbage-in-format-string-error.patch b/0009-Fix-garbage-in-format-string-error.patch index 82e224b..f9d81ab 100644 --- a/0009-Fix-garbage-in-format-string-error.patch +++ b/0009-Fix-garbage-in-format-string-error.patch @@ -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 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 diff --git a/0010-Handle-null-timeout.patch b/0010-Handle-null-timeout.patch index dae6440..2b6e49b 100644 --- a/0010-Handle-null-timeout.patch +++ b/0010-Handle-null-timeout.patch @@ -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 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 diff --git a/0011-Drop-unnecessary-capabilities.patch b/0011-Drop-unnecessary-capabilities.patch index 1c83f70..4277baf 100644 --- a/0011-Drop-unnecessary-capabilities.patch +++ b/0011-Drop-unnecessary-capabilities.patch @@ -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 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) diff --git a/0012-RFC-3442-Classless-Static-Route-Option-for-DHCPv4-51.patch b/0012-RFC-3442-Classless-Static-Route-Option-for-DHCPv4-51.patch index a2804a4..866527c 100644 --- a/0012-RFC-3442-Classless-Static-Route-Option-for-DHCPv4-51.patch +++ b/0012-RFC-3442-Classless-Static-Route-Option-for-DHCPv4-51.patch @@ -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 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 diff --git a/0013-DHCPv6-over-PPP-support-626514.patch b/0013-DHCPv6-over-PPP-support-626514.patch index c9d3811..5e0a6ba 100644 --- a/0013-DHCPv6-over-PPP-support-626514.patch +++ b/0013-DHCPv6-over-PPP-support-626514.patch @@ -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 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 --- diff --git a/0014-IPoIB-support-660681.patch b/0014-IPoIB-support-660681.patch index 3f5a274..a792e4f 100644 --- a/0014-IPoIB-support-660681.patch +++ b/0014-IPoIB-support-660681.patch @@ -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 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]) diff --git a/0015-Add-GUID-DUID-to-dhcpd-logs-1064416.patch b/0015-Add-GUID-DUID-to-dhcpd-logs-1064416.patch index a2f740e..1f88d7d 100644 --- a/0015-Add-GUID-DUID-to-dhcpd-logs-1064416.patch +++ b/0015-Add-GUID-DUID-to-dhcpd-logs-1064416.patch @@ -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 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 --- diff --git a/0016-Turn-on-creating-sending-of-DUID.patch b/0016-Turn-on-creating-sending-of-DUID.patch index 216cbab..bafffb5 100644 --- a/0016-Turn-on-creating-sending-of-DUID.patch +++ b/0016-Turn-on-creating-sending-of-DUID.patch @@ -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 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) diff --git a/0017-Send-unicast-request-release-via-correct-interface.patch b/0017-Send-unicast-request-release-via-correct-interface.patch index 309e143..26c8b96 100644 --- a/0017-Send-unicast-request-release-via-correct-interface.patch +++ b/0017-Send-unicast-request-release-via-correct-interface.patch @@ -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 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) diff --git a/0018-No-subnet-declaration-for-iface-should-be-info-not-e.patch b/0018-No-subnet-declaration-for-iface-should-be-info-not-e.patch index 752ab77..2ff4030 100644 --- a/0018-No-subnet-declaration-for-iface-should-be-info-not-e.patch +++ b/0018-No-subnet-declaration-for-iface-should-be-info-not-e.patch @@ -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 Date: Thu, 21 Feb 2019 10:40:51 +0100 -Subject: [PATCH 18/21] No subnet declaration for ' should be info, not +Subject: [PATCH 18/26] No subnet declaration for ' should be info, not error. Cc: pzhukov@redhat.com diff --git a/0019-dhclient-write-DUID_LLT-even-in-stateless-mode-11563.patch b/0019-dhclient-write-DUID_LLT-even-in-stateless-mode-11563.patch index 4dbd9ff..3405ea1 100644 --- a/0019-dhclient-write-DUID_LLT-even-in-stateless-mode-11563.patch +++ b/0019-dhclient-write-DUID_LLT-even-in-stateless-mode-11563.patch @@ -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 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 diff --git a/0020-Discover-all-hwaddress-for-xid-uniqueness.patch b/0020-Discover-all-hwaddress-for-xid-uniqueness.patch index 025a1ca..c838d7a 100644 --- a/0020-Discover-all-hwaddress-for-xid-uniqueness.patch +++ b/0020-Discover-all-hwaddress-for-xid-uniqueness.patch @@ -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 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 --- diff --git a/0021-Load-leases-DB-in-non-replay-mode-only.patch b/0021-Load-leases-DB-in-non-replay-mode-only.patch index ae72855..72aaeef 100644 --- a/0021-Load-leases-DB-in-non-replay-mode-only.patch +++ b/0021-Load-leases-DB-in-non-replay-mode-only.patch @@ -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 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 --- diff --git a/0022-Backport-sd-notify-patch-for-systemd-support-1687040.patch b/0022-Backport-sd-notify-patch-for-systemd-support-1687040.patch deleted file mode 100644 index 2c9f46b..0000000 --- a/0022-Backport-sd-notify-patch-for-systemd-support-1687040.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 5c6204bab7279050b78b3d03d1211e9d13d3fd71 Mon Sep 17 00:00:00 2001 -From: Pavel Zhukov -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 -+#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 -+#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 - diff --git a/0022-dhclient-make-sure-link-local-address-is-ready-in-st.patch b/0022-dhclient-make-sure-link-local-address-is-ready-in-st.patch new file mode 100644 index 0000000..85ea650 --- /dev/null +++ b/0022-dhclient-make-sure-link-local-address-is-ready-in-st.patch @@ -0,0 +1,80 @@ +From 9975d198a2c02e32c31c3e0f43d2aa79dfa7f508 Mon Sep 17 00:00:00 2001 +From: Pavel Zhukov +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 + diff --git a/0023-option-97-pxe-client-id.patch b/0023-option-97-pxe-client-id.patch new file mode 100644 index 0000000..6cc4328 --- /dev/null +++ b/0023-option-97-pxe-client-id.patch @@ -0,0 +1,247 @@ +From 6fd7894ea57791c8eee16c21d19da34b909e016e Mon Sep 17 00:00:00 2001 +From: Pavel Zhukov +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 + diff --git a/0023-Detect-system-time-jumps.patch b/0024-Detect-system-time-changes.patch similarity index 78% rename from 0023-Detect-system-time-jumps.patch rename to 0024-Detect-system-time-changes.patch index 24eae19..cf38d0d 100644 --- a/0023-Detect-system-time-jumps.patch +++ b/0024-Detect-system-time-changes.patch @@ -1,8 +1,21 @@ +From 41c6032ace65119e6a400365f7e90283c930afd4 Mon Sep 17 00:00:00 2001 +From: Pavel Zhukov +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; diff --git a/0024-bind-Detect-system-time-jumps.patch b/0025-bind-Detect-system-time-changes.patch similarity index 88% rename from 0024-bind-Detect-system-time-jumps.patch rename to 0025-bind-Detect-system-time-changes.patch index eda0c2e..8a52b38 100644 --- a/0024-bind-Detect-system-time-jumps.patch +++ b/0025-bind-Detect-system-time-changes.patch @@ -1,3 +1,18 @@ +From 5917ba14ccf7c7cc2eadf8b6cc666f8be4d2d2a4 Mon Sep 17 00:00:00 2001 +From: Pavel Zhukov +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 + diff --git a/0026-Add-dhclient-5-B-option-description.patch b/0026-Add-dhclient-5-B-option-description.patch new file mode 100644 index 0000000..f76952b --- /dev/null +++ b/0026-Add-dhclient-5-B-option-description.patch @@ -0,0 +1,33 @@ +From 7cae2da1c50c6680b92ca58eb03f9d59315010ba Mon Sep 17 00:00:00 2001 +From: Pavel Zhukov +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 + diff --git a/dhcp.spec b/dhcp.spec index dbb19b6..3b92012 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -63,8 +63,6 @@ Patch26 : 0026-Add-dhclient-5-B-option-description.patch Patch27: 0027-Add-missed-sd-notify-patch-to-manage-dhcpd-with-syst.patch - - BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool From 17d03279ac471e16c33f669147251546f24ca7e9 Mon Sep 17 00:00:00 2001 From: Pavel Zhukov Date: Thu, 7 Nov 2019 14:50:40 +0100 Subject: [PATCH 6/9] Readd systemd patch (#1768604) --- dhcp.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dhcp.spec b/dhcp.spec index 3b92012..8b6b14e 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -530,7 +530,7 @@ done %endif %changelog -* Thu Nov 7 2019 Pavel Zhukov - 12:4.4.1-17 +* Thu Nov 7 2019 Pavel Zhukov - 12:4.4.1-18 - Readd sd-notify patch * Thu Aug 22 2019 Lubomir Rintel - 12:4.4.1-17 From f4fadd1b4d7d63110b7c7084720642dc6a1338bf Mon Sep 17 00:00:00 2001 From: Pavel Zhukov Date: Thu, 7 Nov 2019 14:50:40 +0100 Subject: [PATCH 7/9] Readd systemd patch (#1768604) --- dhcp.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/dhcp.spec b/dhcp.spec index 8b6b14e..9058401 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -530,6 +530,7 @@ done %endif %changelog + * Thu Nov 7 2019 Pavel Zhukov - 12:4.4.1-18 - Readd sd-notify patch From e8f9a11f4739f8b58c2ae3ec6f760418f352393c Mon Sep 17 00:00:00 2001 From: Pavel Zhukov Date: Mon, 11 Nov 2019 10:18:13 +0100 Subject: [PATCH 8/9] Reword -B option manpage --- ...-Add-dhclient-5-B-option-description.patch | 31 +++++++------------ dhcp.spec | 5 ++- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/0026-Add-dhclient-5-B-option-description.patch b/0026-Add-dhclient-5-B-option-description.patch index f76952b..7ddfacf 100644 --- a/0026-Add-dhclient-5-B-option-description.patch +++ b/0026-Add-dhclient-5-B-option-description.patch @@ -1,33 +1,24 @@ -From 7cae2da1c50c6680b92ca58eb03f9d59315010ba Mon Sep 17 00:00:00 2001 -From: Pavel Zhukov -Date: Tue, 22 Oct 2019 16:28:04 +0200 -Subject: [PATCH 26/26] Add dhclient(5) -B option description -Cc: pzhukov@redhat.com +commit 6acfd3125546a0e5db8fae8a9964cd2f88bf68c0 +Author: Pavel Zhukov +Date: Tue Oct 22 16:28:04 2019 +0200 -Bug-Url: https://bugzilla.redhat.com/1764088 ---- - client/dhclient.8 | 8 ++++++++ - 1 file changed, 8 insertions(+) + 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..b466ac7 100644 +index 0145b9f..5226de5 100644 --- a/client/dhclient.8 +++ b/client/dhclient.8 -@@ -552,6 +552,14 @@ Path to the network configuration script invoked by +@@ -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 -+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. ++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 --- -2.14.5 - diff --git a/dhcp.spec b/dhcp.spec index 9058401..225d147 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -15,7 +15,7 @@ Summary: Dynamic host configuration protocol software Name: dhcp Version: 4.4.1 -Release: 18%{?dist} +Release: 19%{?dist} # NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to # dcantrell maintaining the package) made incorrect use of the epoch and @@ -530,6 +530,9 @@ done %endif %changelog +* Mon Nov 11 2019 Pavel Zhukov - 12:4.4.1-19 +- Reword -B option description + * Thu Nov 7 2019 Pavel Zhukov - 12:4.4.1-18 - Readd sd-notify patch From 63b85bfba749b5407a657e999a2fc422e75ec24c Mon Sep 17 00:00:00 2001 From: Pavel Zhukov Date: Tue, 26 Nov 2019 09:51:31 +0100 Subject: [PATCH 9/9] Fix FD leak in confpars --- ...ad-leases-DB-in-non-replay-mode-only.patch | 43 +++++++++---------- dhcp.spec | 5 ++- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/0021-Load-leases-DB-in-non-replay-mode-only.patch b/0021-Load-leases-DB-in-non-replay-mode-only.patch index 72aaeef..d398918 100644 --- a/0021-Load-leases-DB-in-non-replay-mode-only.patch +++ b/0021-Load-leases-DB-in-non-replay-mode-only.patch @@ -1,15 +1,11 @@ -From e2de752020ea51428bbaaa7358f08632c42aa89d Mon Sep 17 00:00:00 2001 -From: Pavel Zhukov -Date: Thu, 21 Feb 2019 10:44:06 +0100 -Subject: [PATCH 21/26] Load leases DB in non-replay mode only -Cc: pzhukov@redhat.com +commit 50c2b3ba8ce030a47b55dd707bb8a6ab20444a05 +Author: Pavel Zhukov +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 - diff --git a/dhcp.spec b/dhcp.spec index 225d147..5761eca 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -15,7 +15,7 @@ Summary: Dynamic host configuration protocol software Name: dhcp Version: 4.4.1 -Release: 19%{?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 @@ -530,6 +530,9 @@ done %endif %changelog +* Tue Nov 26 2019 Pavel Zhukov - 12:4.4.1-20 +- Fix FD leak in confparse + * Mon Nov 11 2019 Pavel Zhukov - 12:4.4.1-19 - Reword -B option description