From 44188b14ccf52096ef9d56f0a11bb153596deb631d7d07f9208ce46a627de0e8 Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski Date: Tue, 13 Oct 2015 13:14:02 +0000 Subject: [PATCH] - Applied a patch by Jiri Popelka catching dhcp server aborts with "Unable to set up timer: out of range" on very long or infinite timer intervals / lease lifetimes (bsc#947780) [+ 0019-dhcp-4.2.4-P1-interval.patch] OBS-URL: https://build.opensuse.org/package/show/network:dhcp/dhcp?expand=0&rev=160 --- 0019-dhcp-4.2.4-P1-interval.patch | 33 +++++++++++++++++++++++++++++++ dhcp.changes | 8 ++++++++ dhcp.spec | 3 +++ 3 files changed, 44 insertions(+) create mode 100644 0019-dhcp-4.2.4-P1-interval.patch diff --git a/0019-dhcp-4.2.4-P1-interval.patch b/0019-dhcp-4.2.4-P1-interval.patch new file mode 100644 index 0000000..ebfa60d --- /dev/null +++ b/0019-dhcp-4.2.4-P1-interval.patch @@ -0,0 +1,33 @@ +commit 9a312e3cd914da2b6f32651c94d1d1d4fb0bf359 +Author: Jiri Popelka +Date: Fri Jul 27 10:00:49 2012 +0200 + + isc_time_nowplusinterval() is not safe with 64-bit time_t (#662254, #789601) + +References: bsc#947780 +Index: dhcp-4.2.4-P2/common/dispatch.c +=================================================================== +--- dhcp-4.2.4-P2.orig/common/dispatch.c ++++ dhcp-4.2.4-P2/common/dispatch.c +@@ -320,7 +320,20 @@ void add_timeout (when, where, what, ref + q->next = timeouts; + timeouts = q; + +- isc_interval_set(&interval, sec & DHCP_SEC_MAX, usec * 1000); ++ /* isc_time_nowplusinterval() is not safe with 64-bit time_t and will ++ * return an error for sufficiently large intervals. We have to limit ++ * the interval to INT_MAX or less to ensure the interval doesn't ++ * overflow 32 bits, since the returned isc_time_t fields are ++ * 32-bit unsigned ints. ++ * ++ * HACK: The 9 is a magic number of seconds, since some time may have ++ * gone by since the last call to gettimeofday() and the one in ++ * isc_time_nowplusinterval(). ++ */ ++ if (sec > TIME_MAX) ++ sec = TIME_MAX - 9; ++ ++ isc_interval_set(&interval, sec, usec * 1000); + status = isc_time_nowplusinterval(&expires, &interval); + if (status != ISC_R_SUCCESS) { + /* diff --git a/dhcp.changes b/dhcp.changes index 14633be..1cd3d03 100644 --- a/dhcp.changes +++ b/dhcp.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Oct 13 12:59:00 UTC 2015 - mt@suse.de + +- Applied a patch by Jiri Popelka catching dhcp server aborts with + "Unable to set up timer: out of range" on very long or infinite + timer intervals / lease lifetimes (bsc#947780) + [+ 0019-dhcp-4.2.4-P1-interval.patch] + ------------------------------------------------------------------- Mon Sep 14 14:39:34 UTC 2015 - mt@suse.de diff --git a/dhcp.spec b/dhcp.spec index 40c7607..54d5558 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -116,6 +116,8 @@ Patch16: 0016-infiniband-support.patch Patch17: 0017-server-no-success-report-before-send.919959.patch # PATCH-FIX-SLE client-fail-on-script-pre-init-error bsc#912098 Patch18: 0018-client-fail-on-script-pre-init-error-bsc-912098.patch +# PATCH-FIX-SLE dhcp-4.2.4-P1-interval bsc#947780 +Patch19: 0019-dhcp-4.2.4-P1-interval.patch ## PreReq: /bin/touch /sbin/chkconfig sysconfig BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -246,6 +248,7 @@ Authors: %patch16 -p1 %patch17 -p1 %patch18 -p1 +%patch19 -p1 ## find . -type f -name \*.cat\* -exec rm -f {} \; dos2unix contrib/ms2isc/*