|
|
@ -1,23 +1,21 @@ |
|
|
|
From e6c8f113fb20f3768e3c35b2f23c694a61c7c5f2 Mon Sep 17 00:00:00 2001 |
|
|
|
From 48574bd8957c1f824a03f866c448dd9b19e060ea Mon Sep 17 00:00:00 2001 |
|
|
|
From: Brent Cook <busterb@gmail.com> |
|
|
|
Date: Tue, 30 Dec 2014 09:02:50 -0600 |
|
|
|
Subject: [PATCH 11/16] conditionally fill in sin_len/sin6_len if they exist |
|
|
|
Subject: [PATCH 12/16] conditionally fill in sin_len/sin6_len if they exist |
|
|
|
|
|
|
|
Should we even be setting these at all? Does anything really rely in |
|
|
|
this anymore? |
|
|
|
---
|
|
|
|
src/usr.sbin/ntpd/config.c | 8 ++++++++ |
|
|
|
1 file changed, 8 insertions(+) |
|
|
|
|
|
|
|
diff --git a/src/usr.sbin/ntpd/config.c b/src/usr.sbin/ntpd/config.c
|
|
|
|
index d660750..b651c62 100644
|
|
|
|
index 22b692b..c01df83 100644
|
|
|
|
--- a/src/usr.sbin/ntpd/config.c
|
|
|
|
+++ b/src/usr.sbin/ntpd/config.c
|
|
|
|
@@ -75,7 +75,9 @@ host_v4(const char *s)
|
|
|
|
if ((h = calloc(1, sizeof(struct ntp_addr))) == NULL) |
|
|
|
fatal(NULL); |
|
|
|
sa_in = (struct sockaddr_in *)&h->ss; |
|
|
|
+#ifdef SIN_LEN
|
|
|
|
+#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
|
|
|
|
sa_in->sin_len = sizeof(struct sockaddr_in); |
|
|
|
+#endif
|
|
|
|
sa_in->sin_family = AF_INET; |
|
|
@ -33,11 +31,11 @@ index d660750..b651c62 100644 |
|
|
|
sa_in6->sin6_family = AF_INET6; |
|
|
|
memcpy(&sa_in6->sin6_addr, |
|
|
|
&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr, |
|
|
|
@@ -141,12 +145,16 @@ host_dns(const char *s, struct ntp_addr **hn)
|
|
|
|
@@ -147,12 +151,16 @@ host_dns(const char *s, struct ntp_addr **hn)
|
|
|
|
h->ss.ss_family = res->ai_family; |
|
|
|
if (res->ai_family == AF_INET) { |
|
|
|
sa_in = (struct sockaddr_in *)&h->ss; |
|
|
|
+#ifdef SIN_LEN
|
|
|
|
+#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
|
|
|
|
sa_in->sin_len = sizeof(struct sockaddr_in); |
|
|
|
+#endif
|
|
|
|
sa_in->sin_addr.s_addr = ((struct sockaddr_in *) |