revert the correction about the logic in dhclient

This commit is contained in:
renmingshuai 2023-06-29 10:10:17 +08:00
parent 2ebc5bcc23
commit d5d1c481f7
2 changed files with 75 additions and 1 deletions

View File

@ -0,0 +1,67 @@
From dbb9d0302f7f5009a871844d6648ea131a3df6b4 Mon Sep 17 00:00:00 2001
From: renmingshuai <renmingshuai@huawei.com>
Date: Thu, 29 Jun 2023 10:04:49 +0800
Subject: [PATCH] revert the correction about the logic in dhclient
Reference:https://gitlab.isc.org/isc-projects/dhcp/-/commit/33e517615f8467a005de2ca2633f52bad323ec2b
https://gitlab.isc.org/isc-projects/dhcp/-/commit/e180ae075ecc989b6b75202d58363f96a8ce0167
---
RELNOTES | 4 ----
client/dhclient.c | 19 +++++--------------
2 files changed, 5 insertions(+), 18 deletions(-)
diff --git a/RELNOTES b/RELNOTES
index 64d45b2..54ad022 100644
--- a/RELNOTES
+++ b/RELNOTES
@@ -51,10 +51,6 @@ by Eric Young (eay@cryptsoft.com).
- Minor corrections were made to allow compilation under gcc 10.
[GitLab #117]
-- The logic in dhclient that causes it to decline DHCPv4 leases if the
- client script exits abnormally (i.e. crashes) has been corrected.
- [GitLab #123]
-
- The limit on the size of a lease file that can be loaded at startup
is now only enforced on 32-bit systems.
[GitLab #92]
diff --git a/client/dhclient.c b/client/dhclient.c
index d20ba66..d39cb5c 100644
--- a/client/dhclient.c
+++ b/client/dhclient.c
@@ -2106,12 +2106,9 @@ void bind_lease (client)
script_write_params(client, "alias_", client->alias);
/* If the BOUND/RENEW code detects another machine using the
- offered address, then per our man page it should exit with
- a non-zero status, to which we send a DHCPDECLINE and toss
- the lease. A return value of less than zero indicates
- the script crashed (e.g. segfault) which script_go will log
- but we will ignore here. */
- if (script_go(client) > 0) {
+ offered address, it exits nonzero. We need to send a
+ DHCPDECLINE and toss the lease. */
+ if (script_go(client)) {
make_decline(client, client->new);
send_decline(client);
destroy_client_lease(client->new);
@@ -5184,14 +5181,8 @@ int script_go(struct client_state *client)
}
dfree (envp, MDL);
gettimeofday(&cur_tv, NULL);
-
- if (!WIFEXITED(wstatus)) {
- int sigval = WTERMSIG(wstatus);
- log_error ("script_go script: %s was terminated by signal %d", scriptName, sigval);
- return (-sigval);
- }
-
- return (WEXITSTATUS(wstatus));
+ return (WIFEXITED (wstatus) ?
+ WEXITSTATUS (wstatus) : -WTERMSIG (wstatus));
}
void client_envadd (struct client_state *client,
--
2.23.0

View File

@ -3,7 +3,7 @@
Name: dhcp
Version: 4.4.3
Release: 1
Release: 2
Summary: Dynamic host configuration protocol software
#Please don't change the epoch on this package
Epoch: 12
@ -58,6 +58,7 @@ Patch37: bugfix-error-message-display.patch
Patch38: backport-Fix-CVE-2021-25220.patch
Patch39: backport-Fix-CVE-2022-2928.patch
Patch40: backport-Fix-CVE-2022-2929.patch
Patch41: Revert-correcting-the-logic-in-dhclient.patch
BuildRequires: gcc autoconf automake libtool openldap-devel krb5-devel libcap-ng-devel
BuildRequires: systemd systemd-devel
@ -306,6 +307,12 @@ exit 0
%{_mandir}/man3/omapi.3.gz
%changelog
* Thu Jun 29 2023 renmingshuai <renmingshuai@huawei.com> - 12:4.4.3-2
- Type:bugfix
- ID:
- SUG:restart
- DESC:revert the correction about the logic in dhclient
* Tue Oct 25 2022 renmingshuai <renmingshuai@huawei.com> - 12:4.4.3-1
- Type:requirement
- ID: