1 Star 0 Fork 24

yoo/dhcp

forked from src-openEuler/dhcp 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Revert-correcting-the-logic-in-dhclient.patch 2.41 KB
一键复制 编辑 原始数据 按行查看 历史
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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mdLUbG/dhcp.git
git@gitee.com:mdLUbG/dhcp.git
mdLUbG
dhcp
dhcp
master

搜索帮助