From 56ef00595736bd408fac9a950c9a4b1b02d57914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E4=B9=89=E8=87=BB?= Date: Mon, 11 Nov 2024 16:10:20 +0800 Subject: [PATCH] bugfix:cancel rebind6 timer after ipv6 expire --- ...ncel-rebind6-timer-after-ipv6-expire.patch | 54 +++++++++++++++++++ dhcp.spec | 9 +++- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 bugfix-cancel-rebind6-timer-after-ipv6-expire.patch diff --git a/bugfix-cancel-rebind6-timer-after-ipv6-expire.patch b/bugfix-cancel-rebind6-timer-after-ipv6-expire.patch new file mode 100644 index 0000000..55eb2c0 --- /dev/null +++ b/bugfix-cancel-rebind6-timer-after-ipv6-expire.patch @@ -0,0 +1,54 @@ +From 6fced85ebcd9563ceb78675d0f4ff3e3d0eea90b Mon Sep 17 00:00:00 2001 +From: huyizhen +Date: Thu, 24 Oct 2024 21:36:06 +0800 +Subject: huawei-cancel-rebind6-timer-after-ipv6-expire + +Solve below question: +Oct 23 16:38:04 localhost dhclient[141133]: PRC: Address 6636::3c depreferred. +Oct 23 16:38:04 localhost dhclient[141133]: XMT: Rebind on enp4s0, interval 00ms. +Oct 23 16:38:04 localhost dhclient[141133]: Impossible condition at dhc6.c:279. +Oct 23 16:38:04 localhost dhclient[141133]: +Oct 23 16:38:04 localhost dhclient[141133]: If you think you have received this message due to a bug rather +Oct 23 16:38:04 localhost dhclient[141133]: than a configuration issue please read the section on submitting +Oct 23 16:38:04 localhost dhclient[141133]: bugs on either our web page at www.isc.org or in the README file +Oct 23 16:38:04 localhost dhclient[141133]: before submitting a bug. These pages explain the proper +Oct 23 16:38:04 localhost dhclient[141133]: process and the information we find helpful for debugging. +Oct 23 16:38:04 localhost dhclient[141133]: +Oct 23 16:38:04 localhost dhclient[141133]: exiting. + +The reason is: +1. After the REBIND message is retransmitted for the second time, the REBIND timer checks whether the REBIND message +is received 5 seconds later and sets the RT field to 0. (Because the 5s timer expires when the timer expires, no next +retransmission will occur.) +2. After 5s, the DEPREFER timer is triggered first. The DEPREFER timer considers that the REBIND timer expires and set +MRD field to 0, but the previously set REBIND timer is not canceled. +3. The REBIND timer is triggered immediately. Because the MRD is set to 0, the retransmission timer considers that the +maximum retransmission duration is not limited and attempts to continue the retransmission. +4. During the retransmission process, the RT value is 0 (retransmission is performed after 0s), and the process exits. +As a result, the DHCP6 function becomes abnormal. + +Solution: +Cencle REBIND timer when DEPREFER timer considers that the REBIND timer expires. + +--- + client/dhc6.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/client/dhc6.c b/client/dhc6.c +index 88fd07d..2dbea60 100644 +--- a/client/dhc6.c ++++ b/client/dhc6.c +@@ -4656,6 +4656,10 @@ dhc6_check_times(struct client_state *client) + * depreffed an address. + */ + client->MRD = hi_expire - cur_time; ++ /* Rebind expired, cancel rebind(do_refresh6) timer. */ ++ if (client->MRD == 0) { ++ cancel_timeout(do_refresh6, client); ++ } + break; + + default: +-- +2.33.0 + diff --git a/dhcp.spec b/dhcp.spec index 3488b76..28a08ba 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -3,7 +3,7 @@ Name: dhcp Version: 4.4.3 -Release: 6 +Release: 7 Summary: Dynamic host configuration protocol software #Please don't change the epoch on this package Epoch: 12 @@ -61,6 +61,7 @@ Patch42: backport-CVE-2022-2795.patch Patch43: backport-CVE-2022-38177.patch Patch44: backport-CVE-2022-38178.patch Patch45: IAID-is-output-has-hexe-if-it-contains-or.patch +Patch46: bugfix-cancel-rebind6-timer-after-ipv6-expire.patch BuildRequires: gcc autoconf automake libtool openldap-devel krb5-devel libcap-ng-devel BuildRequires: systemd systemd-devel @@ -309,6 +310,12 @@ exit 0 %{_mandir}/man3/omapi.3.gz %changelog +* Tue Nov 05 2024 huyizhen - 12:4.4.3-8 +- Type:bugfix +- ID:NA +- SUG:restart +- DESC:cancel rebind6 timer after ipv6 expire + * Sat Jan 20 2024 renmingshuai - 12:4.4.3-6 - Type:bugfix - ID: -- Gitee