aboutsummaryrefslogtreecommitdiffstats
path: root/package/busybox/patches/611-upstream_ntpd_version_fix.patch
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2013-01-19 10:11:34 +0000
committerJo-Philipp Wich <jow@openwrt.org>2013-01-19 10:11:34 +0000
commit4dce17cf6394470488b9d66bc2182018d6b5f5c2 (patch)
tree305bc2d9a9c95522bd835c97169e878c530b532a /package/busybox/patches/611-upstream_ntpd_version_fix.patch
parent473bbcc2c25aee2f8eb1abc14a55abbbc4f4c14a (diff)
downloadmaster-187ad058-4dce17cf6394470488b9d66bc2182018d6b5f5c2.tar.gz
master-187ad058-4dce17cf6394470488b9d66bc2182018d6b5f5c2.tar.bz2
master-187ad058-4dce17cf6394470488b9d66bc2182018d6b5f5c2.zip
busybox: add an upstream ntpd fix (#12841)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35239 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/busybox/patches/611-upstream_ntpd_version_fix.patch')
-rw-r--r--package/busybox/patches/611-upstream_ntpd_version_fix.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/package/busybox/patches/611-upstream_ntpd_version_fix.patch b/package/busybox/patches/611-upstream_ntpd_version_fix.patch
new file mode 100644
index 0000000000..7bcb8475d7
--- /dev/null
+++ b/package/busybox/patches/611-upstream_ntpd_version_fix.patch
@@ -0,0 +1,29 @@
+From b7841cf7b919b16d1bd4619154bf7cb4c22b4ccd Mon Sep 17 00:00:00 2001
+From: Paul Marks <paul@pmarks.net>
+Date: Mon, 14 Jan 2013 01:39:10 +0000
+Subject: ntpd: fix incorrect m_status field in outgoing packets. Closes 5120
+
+When using busybox ntpd with an NTPv3 client and NTPv4 server (or vice
+versa), the version numbers can be incorrectly ORed together, yielding
+the bogus value of "NTPv7". This makes ntpd unusable with clients
+such as Chrony and Windows "Internet Time".
+
+This patch avoids the version mangling, by copying only the Leap
+Indicator bits from the server's status field.
+
+Signed-off-by: Paul Marks <paul@pmarks.net>
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+---
+(limited to 'networking/ntpd.c')
+
+--- a/networking/ntpd.c
++++ b/networking/ntpd.c
+@@ -1794,7 +1794,7 @@ recv_and_process_client_pkt(void /*int f
+
+ /* Build a reply packet */
+ memset(&msg, 0, sizeof(msg));
+- msg.m_status = G.stratum < MAXSTRAT ? G.ntp_status : LI_ALARM;
++ msg.m_status = G.stratum < MAXSTRAT ? (G.ntp_status & LI_MASK) : LI_ALARM;
+ msg.m_status |= (query_status & VERSION_MASK);
+ msg.m_status |= ((query_status & MODE_MASK) == MODE_CLIENT) ?
+ MODE_SERVER : MODE_SYM_PAS;