diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-08-24 11:56:53 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-08-24 11:56:53 +0000 |
commit | 7b01fd486c85eee5c5a3c9438fdc879063061af5 (patch) | |
tree | b5c56bac1cb4f55b585b6e7456951470fcc315d7 /main/chrony | |
parent | 96fe7d3661d0ea57b367d6daad2ea61f82ebeb94 (diff) | |
download | aports-7b01fd486c85eee5c5a3c9438fdc879063061af5.tar.bz2 aports-7b01fd486c85eee5c5a3c9438fdc879063061af5.tar.xz |
main/chrony: upgrade to 1.26
Diffstat (limited to 'main/chrony')
-rw-r--r-- | main/chrony/APKBUILD | 24 | ||||
-rw-r--r-- | main/chrony/chrony-1.20-chrony.conf.example-gentoo.diff | 46 | ||||
-rw-r--r-- | main/chrony/chrony-1.20-conf.c-gentoo.diff | 11 | ||||
-rw-r--r-- | main/chrony/chrony-1.21-makefile.diff | 15 | ||||
-rw-r--r-- | main/chrony/chrony-1.23-reply-ip.diff | 242 | ||||
-rw-r--r-- | main/chrony/chrony-1.23-sources.diff | 56 |
6 files changed, 7 insertions, 387 deletions
diff --git a/main/chrony/APKBUILD b/main/chrony/APKBUILD index bfe76062b..32a74e00f 100644 --- a/main/chrony/APKBUILD +++ b/main/chrony/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=chrony -pkgver=1.23 -pkgrel=8 +pkgver=1.26 +pkgrel=0 pkgdesc="NTP client and server programs" url="http://chrony.tuxfamily.org/" arch="all" @@ -10,11 +10,6 @@ depends="logrotate" makedepends="texinfo" subpackages="$pkgname-doc" source="http://download.tuxfamily.org/chrony/$pkgname-$pkgver.tar.gz - $pkgname-1.20-conf.c-gentoo.diff - $pkgname-1.20-chrony.conf.example-gentoo.diff - $pkgname-1.21-makefile.diff - $pkgname-1.23-sources.diff - $pkgname-1.23-reply-ip.diff chronyd.confd chronyd.initd chrony.logrotate @@ -26,9 +21,10 @@ prepare() { local i cd "$_builddir" - for i in ../*.diff; do - msg "Applying $i" - patch -p1 < $i || return 1 + for i in $source; do + case $i in + *.diff|*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1 + esac done sed -i "s:/etc/chrony:/etc/chrony/chrony:g" \ chrony*.[158] faq.txt chrony.texi || die "sed failed" @@ -48,7 +44,6 @@ package() { cd "$_builddir" make DESTDIR="$pkgdir" install - mv "$pkgdir"/usr/doc "$pkgdir"/usr/share/ install -D -m644 examples/*.example "$pkgdir"/usr/share/doc/chrony/ install -m755 -D "$srcdir"/chronyd.initd "$pkgdir"/etc/init.d/chronyd @@ -59,12 +54,7 @@ package() { touch "$pkgdir"/etc/chrony/chrony.drift install -m644 "$srcdir"/chrony.conf "$pkgdir"/etc/chrony/chrony.conf } -md5sums="ffce77695e55d8efda19ab0b78309c23 chrony-1.23.tar.gz -bd6bd57363865d3ed0c3187d0c9f7151 chrony-1.20-conf.c-gentoo.diff -b2a23e02f7af50bebdd5d18bccdedbf0 chrony-1.20-chrony.conf.example-gentoo.diff -d47015a34b6b2f9eebca77ef939cec72 chrony-1.21-makefile.diff -39cbce9f66638b67623e1ee6bb0f943f chrony-1.23-sources.diff -caa6589a1a1cd56f64957e312d1ef84c chrony-1.23-reply-ip.diff +md5sums="ad6dd619ff1986e4ff780363c64e2246 chrony-1.26.tar.gz d62521b4c8837e15262c47ac88359307 chronyd.confd f0c73948224cc1706cf9c94e4d2d7b69 chronyd.initd 468eaf2b5465d60b3ee021ce3f948ab1 chrony.logrotate diff --git a/main/chrony/chrony-1.20-chrony.conf.example-gentoo.diff b/main/chrony/chrony-1.20-chrony.conf.example-gentoo.diff deleted file mode 100644 index 498b24175..000000000 --- a/main/chrony/chrony-1.20-chrony.conf.example-gentoo.diff +++ /dev/null @@ -1,46 +0,0 @@ ---- a/examples/chrony.conf.example.orig 2003-06-16 11:59:01.000000000 -0400 -+++ b/examples/chrony.conf.example 2003-06-16 12:00:13.000000000 -0400 -@@ -3,5 +3,5 @@ - # - # This is an example chrony configuration file. You should copy it to --# /etc/chrony.conf after uncommenting and editing the options that you -+# /etc/chrony/chrony.conf after uncommenting and editing the options that you - # want to enable. I have not included the more obscure options. Refer - # to the documentation for these. -@@ -91,5 +91,5 @@ - # generally want this, so it is uncommented. - --driftfile /etc/chrony.drift -+driftfile /etc/chrony/chrony.drift - - # If you want to use the program called chronyc to configure aspects of -@@ -100,5 +100,5 @@ - # assumed by default. - --keyfile /etc/chrony.keys -+keyfile /etc/chrony/chrony.keys - - # Tell chronyd which numbered key in the file is used as the password -@@ -158,6 +158,6 @@ - ! log measurements statistics tracking - --If you have real time clock support enabled (see below), you might want --this line instead: -+# If you have real time clock support enabled (see below), you might want -+# this line instead: - - ! log measurements statistics tracking rtc -@@ -269,5 +269,5 @@ - # kernel. (Note, these options apply only to Linux.) - --! rtcfile /etc/chrony.rtc -+! rtcfile /etc/chrony/chrony.rtc - - # Your RTC can be set to keep Universal Coordinated Time (UTC) or local -@@ -285,5 +285,5 @@ - # using devfs), uncomment and edit the following line. - --! rtcdevice /dev/misc/rtc -+rtcdevice /dev/misc/rtc - - ####################################################################### diff --git a/main/chrony/chrony-1.20-conf.c-gentoo.diff b/main/chrony/chrony-1.20-conf.c-gentoo.diff deleted file mode 100644 index 4917d445b..000000000 --- a/main/chrony/chrony-1.20-conf.c-gentoo.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- a/conf.c.orig Sun May 12 14:07:31 2002 -+++ b/conf.c Sun May 12 14:07:52 2002 -@@ -45,7 +45,7 @@ - - /* ================================================== */ - --#define DEFAULT_CONF_FILE "/etc/chrony.conf" -+#define DEFAULT_CONF_FILE "/etc/chrony/chrony.conf" - - /* ================================================== */ - /* Forward prototypes */ diff --git a/main/chrony/chrony-1.21-makefile.diff b/main/chrony/chrony-1.21-makefile.diff deleted file mode 100644 index 2eec4e842..000000000 --- a/main/chrony/chrony-1.21-makefile.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- a/Makefile.in_old 2006-08-12 17:42:57.000000000 +0200 -+++ b/Makefile.in 2006-08-12 17:44:35.000000000 +0200 -@@ -68,10 +68,10 @@ - all : chronyd chronyc - - chronyd : $(OBJS) $(EXTRA_OBJS) -- $(CC) $(OPTFLAGS) -o chronyd $(OBJS) $(EXTRA_OBJS) $(LIBS) $(EXTRA_LIBS) -+ $(CC) $(OPTFLAGS) $(LDFLAGS) -o chronyd $(OBJS) $(EXTRA_OBJS) $(LIBS) $(EXTRA_LIBS) - - chronyc : $(CLI_OBJS) -- $(CC) $(OPTFLAGS) -o chronyc $(CLI_OBJS) @READLINE_LINK@ $(LIBS) $(EXTRA_CLI_LIBS) -+ $(CC) $(OPTFLAGS) $(LDFLAGS) -o chronyc $(CLI_OBJS) @READLINE_LINK@ $(LIBS) $(EXTRA_CLI_LIBS) - - client.o : client.c - $(CC) $(CFLAGS) $(DEFS) @READLINE_COMPILE@ -c $< diff --git a/main/chrony/chrony-1.23-reply-ip.diff b/main/chrony/chrony-1.23-reply-ip.diff deleted file mode 100644 index f4e5d8eff..000000000 --- a/main/chrony/chrony-1.23-reply-ip.diff +++ /dev/null @@ -1,242 +0,0 @@ - -Currently, on multihomed host, when chrony is not bound to a specific -IP address, a query is sent to an interface and the default source IP -hint for the back route differs, the reply will have a source IP -different than where the query was destinied to. This will cause -problems because connection tracking firewalls will drop the replies -and most likely the client program will get confused too. - -This patch uses the IP_PKTINFO mechanism to get the IP address where -received packets where targetted to and use that IP address as source -hint when sending a reply. ---- - addressing.h | 1 + - broadcast.c | 1 + - cmdmon.c | 3 ++ - conf.c | 1 + - ntp_io.c | 92 +++++++++++++++++++++++++++++++++++++++++---------------- - 5 files changed, 72 insertions(+), 26 deletions(-) - -diff --git a/addressing.h b/addressing.h -index aa20ed9..05152f4 100644 ---- a/addressing.h -+++ b/addressing.h -@@ -36,6 +36,7 @@ - typedef struct { - unsigned long ip_addr; - unsigned short port; -+ unsigned long local_ip_addr; - } NTP_Remote_Address; - - #if 0 -diff --git a/broadcast.c b/broadcast.c -index be217e7..c979741 100644 ---- a/broadcast.c -+++ b/broadcast.c -@@ -146,6 +146,7 @@ BRD_AddDestination(unsigned long addr, unsigned short port, int interval) - - destinations[n_destinations].addr.ip_addr = addr; - destinations[n_destinations].addr.port = port; -+ destinations[n_destinations].addr.local_ip_addr = 0; - destinations[n_destinations].interval = interval; - - SCH_AddTimeoutInClass((double) interval, 1.0, -diff --git a/cmdmon.c b/cmdmon.c -index 819977c..8affb0b 100644 ---- a/cmdmon.c -+++ b/cmdmon.c -@@ -1097,6 +1097,7 @@ handle_add_server(CMD_Request *rx_message, CMD_Reply *tx_message) - - rem_addr.ip_addr = ntohl(rx_message->data.ntp_source.ip_addr); - rem_addr.port = (unsigned short)(ntohl(rx_message->data.ntp_source.port)); -+ rem_addr.local_ip_addr = 0; - params.minpoll = ntohl(rx_message->data.ntp_source.minpoll); - params.maxpoll = ntohl(rx_message->data.ntp_source.maxpoll); - params.presend_minpoll = ntohl(rx_message->data.ntp_source.presend_minpoll); -@@ -1133,6 +1134,7 @@ handle_add_peer(CMD_Request *rx_message, CMD_Reply *tx_message) - - rem_addr.ip_addr = ntohl(rx_message->data.ntp_source.ip_addr); - rem_addr.port = (unsigned short)(ntohl(rx_message->data.ntp_source.port)); -+ rem_addr.local_ip_addr = 0; - params.minpoll = ntohl(rx_message->data.ntp_source.minpoll); - params.maxpoll = ntohl(rx_message->data.ntp_source.maxpoll); - params.presend_minpoll = ntohl(rx_message->data.ntp_source.presend_minpoll); -@@ -1167,6 +1169,7 @@ handle_del_source(CMD_Request *rx_message, CMD_Reply *tx_message) - - rem_addr.ip_addr = ntohl(rx_message->data.del_source.ip_addr); - rem_addr.port = 0; -+ rem_addr.local_ip_addr = 0; - - status = NSR_RemoveSource(&rem_addr); - switch (status) { -diff --git a/conf.c b/conf.c -index e34927e..ddd13f1 100644 ---- a/conf.c -+++ b/conf.c -@@ -949,6 +949,7 @@ CNF_AddSources(void) { - for (i=0; i<n_ntp_sources; i++) { - server.ip_addr = ntp_sources[i].ip_addr; - server.port = ntp_sources[i].port; -+ server.local_ip_addr = 0; - - switch (ntp_sources[i].type) { - case SERVER: -diff --git a/ntp_io.c b/ntp_io.c -index afb6ad1..db89758 100644 ---- a/ntp_io.c -+++ b/ntp_io.c -@@ -118,6 +118,12 @@ NIO_Initialise(void) - LOG(LOGS_ERR, LOGF_NtpIO, "Could not set broadcast socket options"); - /* Don't quit - we might survive anyway */ - } -+ /* We want the local IP info too */ -+ if (setsockopt(sock_fd, IPPROTO_IP, IP_PKTINFO, (char *)&on_off, sizeof(on_off)) < 0) { -+ LOG(LOGS_ERR, LOGF_NtpIO, "Could not request packet info using socket option"); -+ /* Don't quit - we might survive anyway */ -+ } -+ - - /* Bind the port */ - my_addr.sin_family = AF_INET; -@@ -182,22 +188,30 @@ read_from_socket(void *anything) - - int status; - ReceiveBuffer message; -- int message_length; - struct sockaddr_in where_from; -- socklen_t from_length; - unsigned int flags = 0; - struct timeval now; - NTP_Remote_Address remote_addr; - double local_clock_err; -+ char cmsgbuf[256]; -+ struct cmsghdr *cmsg; -+ struct msghdr msg; -+ struct iovec iov; - - assert(initialised); - -- from_length = sizeof(where_from); -- message_length = sizeof(message); -+ iov.iov_base = message.arbitrary; -+ iov.iov_len = sizeof(message); -+ msg.msg_name = &where_from; -+ msg.msg_namelen = sizeof(where_from); -+ msg.msg_iov = &iov; -+ msg.msg_iovlen = 1; -+ msg.msg_control = (void *) cmsgbuf; -+ msg.msg_controllen = sizeof(cmsgbuf); -+ msg.msg_flags = 0; - - LCL_ReadCookedTime(&now, &local_clock_err); -- status = recvfrom(sock_fd, (char *)&message, message_length, flags, -- (struct sockaddr *)&where_from, &from_length); -+ status = recvmsg(sock_fd, &msg, flags); - - /* Don't bother checking if read failed or why if it did. More - likely than not, it will be connection refused, resulting from a -@@ -209,6 +223,13 @@ read_from_socket(void *anything) - if (status > 0) { - remote_addr.ip_addr = ntohl(where_from.sin_addr.s_addr); - remote_addr.port = ntohs(where_from.sin_port); -+ remote_addr.local_ip_addr = 0; -+ -+ for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { -+ if (cmsg->cmsg_level == IPPROTO_IP && cmsg->cmsg_type == IP_PKTINFO) -+ remote_addr.local_ip_addr = -+ ntohl(((struct in_pktinfo *) CMSG_DATA(cmsg))->ipi_spec_dst.s_addr); -+ } - - if (status == NTP_NORMAL_PACKET_SIZE) { - -@@ -229,21 +250,45 @@ read_from_socket(void *anything) - } - - /* ================================================== */ --/* Send an unauthenticated packet to a given address */ -+/* Send a packet to given address */ - --void --NIO_SendNormalPacket(NTP_Packet *packet, NTP_Remote_Address *remote_addr) -+static void -+NIO_SendPacket(NTP_Packet *packet, int packetlen, NTP_Remote_Address *remote_addr) - { - struct sockaddr_in remote; -+ struct msghdr msg; -+ struct iovec iov; -+ struct { -+ struct cmsghdr cm; -+ struct in_pktinfo ipi; -+ } cmsg; - - assert(initialised); - - remote.sin_family = AF_INET; - remote.sin_port = htons(remote_addr->port); - remote.sin_addr.s_addr = htonl(remote_addr->ip_addr); -+ iov.iov_base = (void *) packet; -+ iov.iov_len = packetlen; -+ msg.msg_name = &remote; -+ msg.msg_namelen = sizeof(remote); -+ msg.msg_iov = &iov; -+ msg.msg_iovlen = 1; -+ if (remote_addr->local_ip_addr) { -+ cmsg.cm.cmsg_len = sizeof(cmsg); -+ cmsg.cm.cmsg_level = IPPROTO_IP; -+ cmsg.cm.cmsg_type = IP_PKTINFO; -+ memset(&cmsg.ipi, 0, sizeof(cmsg.ipi)); -+ cmsg.ipi.ipi_spec_dst.s_addr = htonl(remote_addr->local_ip_addr); -+ msg.msg_control = (void *) &cmsg; -+ msg.msg_controllen = sizeof(cmsg); -+ } else { -+ msg.msg_control = NULL; -+ msg.msg_controllen = 0; -+ } -+ msg.msg_flags = 0; - -- if (sendto(sock_fd, (void *) packet, NTP_NORMAL_PACKET_SIZE, 0, -- (struct sockaddr *) &remote, sizeof(remote)) < 0) { -+ if (sendmsg(sock_fd, &msg, 0) < 0) { - LOG(LOGS_WARN, LOGF_NtpIO, "Could not send to %s:%d : %s", - UTI_IPToDottedQuad(remote_addr->ip_addr), remote_addr->port, strerror(errno)); - } -@@ -252,26 +297,21 @@ NIO_SendNormalPacket(NTP_Packet *packet, NTP_Remote_Address *remote_addr) - } - - /* ================================================== */ --/* Send an authenticated packet to a given address */ -+/* Send an unauthenticated packet to a given address */ - - void --NIO_SendAuthenticatedPacket(NTP_Packet *packet, NTP_Remote_Address *remote_addr) -+NIO_SendNormalPacket(NTP_Packet *packet, NTP_Remote_Address *remote_addr) - { -- struct sockaddr_in remote; -- -- assert(initialised); -- -- remote.sin_family = AF_INET; -- remote.sin_port = htons(remote_addr->port); -- remote.sin_addr.s_addr = htonl(remote_addr->ip_addr); -+ NIO_SendPacket(packet, NTP_NORMAL_PACKET_SIZE, remote_addr); -+} - -- if (sendto(sock_fd, (void *) packet, sizeof(NTP_Packet), 0, -- (struct sockaddr *) &remote, sizeof(remote)) < 0) { -- LOG(LOGS_WARN, LOGF_NtpIO, "Could not send to %s:%d : %s", -- UTI_IPToDottedQuad(remote_addr->ip_addr), remote_addr->port, strerror(errno)); -- } -+/* ================================================== */ -+/* Send an authenticated packet to a given address */ - -- return; -+void -+NIO_SendAuthenticatedPacket(NTP_Packet *packet, NTP_Remote_Address *remote_addr) -+{ -+ NIO_SendPacket(packet, sizeof(NTP_Packet), remote_addr); - } - - /* ================================================== */ --- -1.5.6.3 - diff --git a/main/chrony/chrony-1.23-sources.diff b/main/chrony/chrony-1.23-sources.diff deleted file mode 100644 index 5f39ca332..000000000 --- a/main/chrony/chrony-1.23-sources.diff +++ /dev/null @@ -1,56 +0,0 @@ -commit 2f2446c7dc074b2d1728a5e3f7a600c10cea2425 -Author: Goswin Brederlow <brederlo@informatik.uni-tuebingen.de> -Date: Sat Mar 29 20:49:59 2008 +0000 - - Fix for chronyc "sources" command on 64 bit machines - - (Taken from - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=348412 - ) - - Attached is a patchlet to make the "sources" command of chrony output properly - signed numbers. The chronyd code (see e.g. ntp.h) properly uses int32_t and - friends to get the right number of bits per datatype while client.c just uses - short, int, long. But long will be 64 bit or 32 bit depending on the cpu. - -diff --git a/client.c b/client.c -index b7e5bcb..85d6e84 100644 ---- a/client.c -+++ b/client.c -@@ -45,6 +45,12 @@ - #include <readline/history.h> - #endif - -+#ifdef HAS_STDINT_H -+#include <stdint.h> -+#elif defined(HAS_INTTYPES_H) -+#include <inttypes.h> -+#endif -+ - /* ================================================== */ - - static int sock_fd; -@@ -1383,16 +1389,16 @@ process_cmd_sources(char *line) - int n_sources, i; - int verbose = 0; - -- long orig_latest_meas, latest_meas, est_offset; -- unsigned long ip_addr; -- unsigned long latest_meas_err, est_offset_err; -- unsigned long latest_meas_ago; -- unsigned short poll, stratum; -- unsigned short state, mode; -+ int32_t orig_latest_meas, latest_meas, est_offset; -+ uint32_t ip_addr; -+ uint32_t latest_meas_err, est_offset_err; -+ uint32_t latest_meas_ago; -+ uint16_t poll, stratum; -+ uint16_t state, mode; - double resid_freq, resid_skew; - const char *dns_lookup; - char hostname_buf[32]; -- unsigned short status; -+ uint16_t status; - - /* Check whether to output verbose headers */ - verbose = check_for_verbose_flag(line); |