[arch-commits] Commit in dhcp/trunk (PKGBUILD dhcp-honor-expired.patch)
Jan Steffens
heftig at archlinux.org
Sun Apr 24 13:36:32 UTC 2016
Date: Sunday, April 24, 2016 @ 15:36:32
Author: heftig
Revision: 266110
4.3.4-2
Added:
dhcp/trunk/dhcp-honor-expired.patch
Modified:
dhcp/trunk/PKGBUILD
--------------------------+
PKGBUILD | 15 ++++++++++---
dhcp-honor-expired.patch | 49 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 4 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2016-04-24 11:39:25 UTC (rev 266109)
+++ PKGBUILD 2016-04-24 13:36:32 UTC (rev 266110)
@@ -8,7 +8,7 @@
# separate patch levels with a period to maintain proper versioning.
pkgver=4.3.4
_pkgver=4.3.4
-pkgrel=1
+pkgrel=2
arch=('i686' 'x86_64')
license=('custom:isc-dhcp')
url="https://www.isc.org/software/dhcp"
@@ -19,7 +19,8 @@
dhclient at .service
dhcp-4.3.1-client_script-1.patch
dhcp-4.3.1-missing_ipv6-1.patch
- arch_patch_over_lfs.patch)
+ arch_patch_over_lfs.patch
+ dhcp-honor-expired.patch)
md5sums=('0138319fe2b788cf4bdf34fbeaf9ff54'
'SKIP'
'33cceed7056fdceda845eef26934f30f'
@@ -27,7 +28,8 @@
'06aa2ae46f05fdc784275e6ae54a8f7f'
'c02bddb6c6c33c5885e3dd072ee2ee40'
'da655f02f1cf4d95b4708e84e69edbc8'
- 'ea45057374098b8ff7e140ecedf7696a')
+ 'ea45057374098b8ff7e140ecedf7696a'
+ '10a2332307ad8ccc8993a18ffd7165cb')
validpgpkeys=('ADBE9446286C794905F1E0756FA6EBC9911A4C02') # Internet Systems Consortium, Inc. <codesign at isc.org>
prepare() {
@@ -44,6 +46,10 @@
# Apply Arch-specific patches over LSF changes
patch -Np1 -i ../arch_patch_over_lfs.patch
+
+ # Sourced from Fedora - required for NM
+ # https://bugzilla.gnome.org/show_bug.cgi?id=748268
+ patch -Np1 -i ../dhcp-honor-expired.patch
}
build() {
@@ -52,7 +58,8 @@
--with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \
--with-srv6-lease-file=/var/lib/dhcp/dhcpd6.leases \
--with-cli-lease-file=/var/lib/dhclient/dhclient.leases \
- --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases
+ --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases \
+ --enable-binary-leases
make -j1
}
Added: dhcp-honor-expired.patch
===================================================================
--- dhcp-honor-expired.patch (rev 0)
+++ dhcp-honor-expired.patch 2016-04-24 13:36:32 UTC (rev 266110)
@@ -0,0 +1,49 @@
+diff -up dhcp-4.3.0a1/client/dhc6.c.honor-expired dhcp-4.3.0a1/client/dhc6.c
+--- dhcp-4.3.0a1/client/dhc6.c.honor-expired 2013-12-19 16:00:28.062183037 +0100
++++ dhcp-4.3.0a1/client/dhc6.c 2013-12-19 16:00:28.076182842 +0100
+@@ -1351,6 +1351,32 @@ start_info_request6(struct client_state
+ go_daemon();
+ }
+
++/* Run through the addresses in lease and return true if there's any unexpired.
++ * Return false otherwise.
++ */
++isc_boolean_t
++unexpired_address_in_lease(struct dhc6_lease *lease)
++{
++ struct dhc6_ia *ia;
++ struct dhc6_addr *addr;
++
++ for (ia = lease->bindings ; ia != NULL ; ia = ia->next) {
++ for (addr = ia->addrs ; addr != NULL ; addr = addr->next) {
++ if (addr->flags & DHC6_ADDR_EXPIRED)
++ continue;
++
++ if (addr->starts + addr->max_life > cur_time) {
++ return ISC_TRUE;
++ }
++ }
++ }
++
++ log_info("PRC: Previous lease is devoid of active addresses."
++ " Re-initializing.");
++
++ return ISC_FALSE;
++}
++
+ /*
+ * start_confirm6() kicks off an "init-reboot" version of the process, at
+ * startup to find out if old bindings are 'fair' and at runtime whenever
+@@ -1363,8 +1389,10 @@ start_confirm6(struct client_state *clie
+
+ /* If there is no active lease, there is nothing to check. */
+ if ((client->active_lease == NULL) ||
+- !active_prefix(client) ||
+- client->active_lease->released) {
++ !active_prefix(client) ||
++ client->active_lease->released ||
++ !unexpired_address_in_lease(client->active_lease)) {
++ dhc6_lease_destroy(&client->active_lease, MDL);
+ start_init6(client);
+ return;
+ }
More information about the arch-commits
mailing list