|
@ -1,4 +1,4 @@ |
|
|
From a9c2be7c74c101e4ca0d6ce77fdde7dd20936b3d Mon Sep 17 00:00:00 2001 |
|
|
|
|
|
|
|
|
From b677780a12f57f2d1221e6df0f46e2600630b440 Mon Sep 17 00:00:00 2001 |
|
|
From: Brent Cook <bcook@openbsd.org> |
|
|
From: Brent Cook <bcook@openbsd.org> |
|
|
Date: Sun, 6 Dec 2015 22:35:38 -0600 |
|
|
Date: Sun, 6 Dec 2015 22:35:38 -0600 |
|
|
Subject: [PATCH 11/13] Deal with missing SO_TIMESTAMP |
|
|
Subject: [PATCH 11/13] Deal with missing SO_TIMESTAMP |
|
@ -11,10 +11,10 @@ Fall back to the previous client.c implementation when it is not found. |
|
|
1 file changed, 9 insertions(+), 1 deletion(-) |
|
|
1 file changed, 9 insertions(+), 1 deletion(-) |
|
|
|
|
|
|
|
|
diff --git a/src/usr.sbin/ntpd/client.c b/src/usr.sbin/ntpd/client.c
|
|
|
diff --git a/src/usr.sbin/ntpd/client.c b/src/usr.sbin/ntpd/client.c
|
|
|
index 3d70317d9..5619454fb 100644
|
|
|
|
|
|
|
|
|
index aa9fc24c6..bb5c4f4c0 100644
|
|
|
--- a/src/usr.sbin/ntpd/client.c
|
|
|
--- a/src/usr.sbin/ntpd/client.c
|
|
|
+++ b/src/usr.sbin/ntpd/client.c
|
|
|
+++ b/src/usr.sbin/ntpd/client.c
|
|
|
@@ -163,10 +163,12 @@ client_query(struct ntp_peer *p)
|
|
|
|
|
|
|
|
|
@@ -175,10 +175,12 @@ client_query(struct ntp_peer *p)
|
|
|
if (p->addr->ss.ss_family == AF_INET && setsockopt(p->query->fd, |
|
|
if (p->addr->ss.ss_family == AF_INET && setsockopt(p->query->fd, |
|
|
IPPROTO_IP, IP_TOS, &val, sizeof(val)) == -1) |
|
|
IPPROTO_IP, IP_TOS, &val, sizeof(val)) == -1) |
|
|
log_warn("setsockopt IPTOS_LOWDELAY"); |
|
|
log_warn("setsockopt IPTOS_LOWDELAY"); |
|
@ -27,7 +27,7 @@ index 3d70317d9..5619454fb 100644 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* |
|
|
/* |
|
|
@@ -213,7 +215,9 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime)
|
|
|
|
|
|
|
|
|
@@ -225,7 +227,9 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime)
|
|
|
struct cmsghdr hdr; |
|
|
struct cmsghdr hdr; |
|
|
char buf[CMSG_SPACE(sizeof(tv))]; |
|
|
char buf[CMSG_SPACE(sizeof(tv))]; |
|
|
} cmsgbuf; |
|
|
} cmsgbuf; |
|
@ -37,7 +37,7 @@ index 3d70317d9..5619454fb 100644 |
|
|
ssize_t size; |
|
|
ssize_t size; |
|
|
double T1, T2, T3, T4; |
|
|
double T1, T2, T3, T4; |
|
|
time_t interval; |
|
|
time_t interval; |
|
|
@@ -226,7 +230,6 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime)
|
|
|
|
|
|
|
|
|
@@ -238,7 +242,6 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime)
|
|
|
somsg.msg_control = cmsgbuf.buf; |
|
|
somsg.msg_control = cmsgbuf.buf; |
|
|
somsg.msg_controllen = sizeof(cmsgbuf.buf); |
|
|
somsg.msg_controllen = sizeof(cmsgbuf.buf); |
|
|
|
|
|
|
|
@ -45,7 +45,7 @@ index 3d70317d9..5619454fb 100644 |
|
|
if ((size = recvmsg(p->query->fd, &somsg, 0)) == -1) { |
|
|
if ((size = recvmsg(p->query->fd, &somsg, 0)) == -1) { |
|
|
if (errno == EHOSTUNREACH || errno == EHOSTDOWN || |
|
|
if (errno == EHOSTUNREACH || errno == EHOSTDOWN || |
|
|
errno == ENETUNREACH || errno == ENETDOWN || |
|
|
errno == ENETUNREACH || errno == ENETDOWN || |
|
|
@@ -251,6 +254,8 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime)
|
|
|
|
|
|
|
|
|
@@ -263,6 +266,8 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime)
|
|
|
return (0); |
|
|
return (0); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -54,7 +54,7 @@ index 3d70317d9..5619454fb 100644 |
|
|
for (cmsg = CMSG_FIRSTHDR(&somsg); cmsg != NULL; |
|
|
for (cmsg = CMSG_FIRSTHDR(&somsg); cmsg != NULL; |
|
|
cmsg = CMSG_NXTHDR(&somsg, cmsg)) { |
|
|
cmsg = CMSG_NXTHDR(&somsg, cmsg)) { |
|
|
if (cmsg->cmsg_level == SOL_SOCKET && |
|
|
if (cmsg->cmsg_level == SOL_SOCKET && |
|
|
@@ -260,6 +265,9 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime)
|
|
|
|
|
|
|
|
|
@@ -272,6 +277,9 @@ client_dispatch(struct ntp_peer *p, u_int8_t settime)
|
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -65,5 +65,5 @@ index 3d70317d9..5619454fb 100644 |
|
|
if (T4 < JAN_1970) { |
|
|
if (T4 < JAN_1970) { |
|
|
client_log_error(p, "recvmsg control format", EBADF); |
|
|
client_log_error(p, "recvmsg control format", EBADF); |
|
|
--
|
|
|
--
|
|
|
2.11.0 |
|
|
|
|
|
|
|
|
2.13.0 |
|
|
|
|
|
|