summaryrefslogtreecommitdiff
path: root/package/openntpd/patches
diff options
context:
space:
mode:
authorwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
committerwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
commit219a6dab8995aad9ac4860cc1a84d6f3509a03a4 (patch)
treeb9c0f3c43aebba2fcfef777592d0add39f2072f4 /package/openntpd/patches
Initial import
Diffstat (limited to 'package/openntpd/patches')
-rw-r--r--package/openntpd/patches/patch-client_c17
-rw-r--r--package/openntpd/patches/patch-configure_ac18
-rw-r--r--package/openntpd/patches/patch-defines_h17
-rw-r--r--package/openntpd/patches/patch-ntpd_h47
-rw-r--r--package/openntpd/patches/patch-openbsd-compat_Makefile_in15
-rw-r--r--package/openntpd/patches/patch-openbsd-compat_openbsd-compat_h18
6 files changed, 132 insertions, 0 deletions
diff --git a/package/openntpd/patches/patch-client_c b/package/openntpd/patches/patch-client_c
new file mode 100644
index 000000000..37c0c89a7
--- /dev/null
+++ b/package/openntpd/patches/patch-client_c
@@ -0,0 +1,17 @@
+$Id$
+
+ bugfix from MirBSD ntpd: do not hardcode the number
+ of required adjustment offsets, use the constant
+ instead, MirOS commitid 10047041D2145A88E16
+
+--- openntpd-3.9p1.orig/client.c Sun May 14 05:28:58 2006
++++ openntpd-3.9p1/client.c Mon Oct 8 12:08:30 2007
+@@ -314,7 +314,7 @@ client_update(struct ntp_peer *p)
+ best = i;
+ }
+
+- if (good < 8)
++ if (good < OFFSET_ARRAY_SIZE)
+ return (-1);
+
+ memcpy(&p->update, &p->reply[best], sizeof(p->update));
diff --git a/package/openntpd/patches/patch-configure_ac b/package/openntpd/patches/patch-configure_ac
new file mode 100644
index 000000000..aa98cb71d
--- /dev/null
+++ b/package/openntpd/patches/patch-configure_ac
@@ -0,0 +1,18 @@
+$Id$
+
+ part of the "adjtime-linux" patch
+
+--- openntpd-3.9p1.orig/configure.ac 2006-05-14 05:29:23.000000000 +0000
++++ openntpd-3.9p1/configure.ac 2007-01-28 20:49:48.000000000 +0000
+@@ -617,6 +617,11 @@ else
+ fi
+ AC_SUBST(mansubdir)
+
++AC_ARG_WITH(adjtimex,
++ [ --with-adjtimex Use adjtimex to adjust kernel skew],
++ [ AC_DEFINE(USE_ADJTIMEX, [], [Use adjust skew with adjtimex (experimental)]) ]
++)
++
+ # Search for OpenSSL if required.
+ if test "$ac_cv_func_arc4random" != "yes" && test "x$builtin_arc4random" != "xyes"; then
+ saved_CPPFLAGS="$CPPFLAGS"
diff --git a/package/openntpd/patches/patch-defines_h b/package/openntpd/patches/patch-defines_h
new file mode 100644
index 000000000..9e2b35bf1
--- /dev/null
+++ b/package/openntpd/patches/patch-defines_h
@@ -0,0 +1,17 @@
+$Id$
+
+ part of the "adjtime-linux" patch
+
+--- openntpd-3.9p1.orig/defines.h 2006-05-14 05:29:21.000000000 +0000
++++ openntpd-3.9p1/defines.h 2007-01-28 20:49:48.000000000 +0000
+@@ -20,6 +20,10 @@
+ # define setproctitle(x)
+ #endif
+
++#ifdef USE_ADJTIMEX
++# define adjtime(a,b) (_compat_adjtime((a),(b)))
++#endif
++
+ #if !defined(SA_LEN)
+ # if defined(HAVE_STRUCT_SOCKADDR_SA_LEN)
+ # define SA_LEN(x) ((x)->sa_len)
diff --git a/package/openntpd/patches/patch-ntpd_h b/package/openntpd/patches/patch-ntpd_h
new file mode 100644
index 000000000..9189d6204
--- /dev/null
+++ b/package/openntpd/patches/patch-ntpd_h
@@ -0,0 +1,47 @@
+$Id$
+
+ ‣ OFFSET_ARRAY_SIZE
+ pull in the following diff from MirBSD:
+ | Commit ID: 100470A1C1009540C55
+ | CVSROOT: /cvs
+ | Module name: src
+ | Changes by: tg@herc.mirbsd.org 2007/10/08 12:04:34 UTC
+ |
+ | Modified files:
+ | usr.sbin/ntpd : ntpd.h
+ |
+ | Log message:
+ | reduce the number of probes in the clock filter down to 4, so that adjtime
+ | is called at least approx. 3 times a hour, greatly helping us to reduce the
+ | size of the spikes for systems with clock drift (but increasing susceptibi-
+ | lity to latency-induced low-quality responses)
+ |
+ | tested on herc/rant with a value of 3 (adjust about 4 times an hour)
+ |
+ | XXX this should be made an ntpd.conf option instead of a define ASAP
+ | XXX this should be reverted once we have adjfreq(2)
+ but we use 3 here due to employment of adjtimex() which reduces
+ usability of older deltas
+
+ ‣ SETTIME_MIN_OFFSET
+ reduce the minimum required time offset for 'ntpd -s' to
+ use settimeofday() instead of adjtime(), in order to provide
+ a faster time setting at start, since adjusting can take ages
+
+--- openntpd-3.9p1.orig/ntpd.h Sun May 14 05:28:58 2006
++++ openntpd-3.9p1/ntpd.h Mon Oct 8 12:17:58 2007
+@@ -55,8 +55,12 @@
+ #define QSCALE_OFF_MAX 0.50
+
+ #define QUERYTIME_MAX 15 /* single query might take n secs max */
+-#define OFFSET_ARRAY_SIZE 8
+-#define SETTIME_MIN_OFFSET 180 /* min offset for settime at start */
++#ifdef USE_ADJTIMEX
++#define OFFSET_ARRAY_SIZE 3 /* so they get invalidated faster */
++#else
++#define OFFSET_ARRAY_SIZE 4 /* min. 3, recommended 6, max. 8 */
++#endif
++#define SETTIME_MIN_OFFSET 12 /* min offset for settime at start */
+ #define SETTIME_TIMEOUT 15 /* max seconds to wait with -s */
+ #define LOG_NEGLIGEE 128 /* negligible drift to not log (ms) */
+
diff --git a/package/openntpd/patches/patch-openbsd-compat_Makefile_in b/package/openntpd/patches/patch-openbsd-compat_Makefile_in
new file mode 100644
index 000000000..c2660e499
--- /dev/null
+++ b/package/openntpd/patches/patch-openbsd-compat_Makefile_in
@@ -0,0 +1,15 @@
+$Id$
+
+ part of the "adjtime-linux" patch
+
+--- openntpd-3.9p1.orig/openbsd-compat/Makefile.in 2006-05-14 05:29:19.000000000 +0000
++++ openntpd-3.9p1/openbsd-compat/Makefile.in 2007-01-28 20:49:48.000000000 +0000
+@@ -9,7 +9,7 @@ OPENBSD= asprintf.o daemon.o errx.o inet
+ COMPAT= atomicio.o bsd-arc4random.o bsd-misc.o bsd-poll.o \
+ bsd-snprintf.o bsd-getifaddrs.o bsd-setresuid.o \
+ bsd-setresgid.o fake-rfc2553.o
+-PORT= port-qnx.o
++PORT= port-linux.o port-qnx.o
+
+ VPATH=@srcdir@
+ CC=@CC@
diff --git a/package/openntpd/patches/patch-openbsd-compat_openbsd-compat_h b/package/openntpd/patches/patch-openbsd-compat_openbsd-compat_h
new file mode 100644
index 000000000..cdc7cc679
--- /dev/null
+++ b/package/openntpd/patches/patch-openbsd-compat_openbsd-compat_h
@@ -0,0 +1,18 @@
+$Id$
+
+ part of the "adjtime-linux" patch
+
+--- openntpd-3.9p1.orig/openbsd-compat/openbsd-compat.h 2006-05-14 05:29:19.000000000 +0000
++++ openntpd-3.9p1/openbsd-compat/openbsd-compat.h 2007-01-28 20:49:48.000000000 +0000
+@@ -46,6 +46,11 @@ int asprintf(char **, const char *,
+ __attribute__((__format__ (printf, 2, 3)));
+ #endif
+
++#ifdef USE_ADJTIMEX
++# include <sys/time.h>
++int _compat_adjtime(const struct timeval *, struct timeval *);
++#endif
++
+ #ifndef HAVE_INET_PTON
+ int inet_pton(int, const char *, void *);
+ #endif