Portable build framework for OpenNTPD
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

41 lines
1.3 KiB

From 23bd483c6f15ae1237eb7764110590706f13c108 Mon Sep 17 00:00:00 2001
From: Brent Cook <busterb@gmail.com>
Date: Tue, 30 Dec 2014 09:10:22 -0600
Subject: [PATCH 01/12] Handle IPv6 DNS records on IPv4 networks more liberally
Rather than fail on IPv4 only networks when seeing an IPv6 DNS record,
just give a warning.
Debian bug ID: 500676.
Original Author: Stefan Praszalowicz <stefan.praszalowicz@avedya.com>
---
src/usr.sbin/ntpd/client.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/usr.sbin/ntpd/client.c b/src/usr.sbin/ntpd/client.c
index 1d982d6..e717d69 100644
--- a/src/usr.sbin/ntpd/client.c
+++ b/src/usr.sbin/ntpd/client.c
@@ -138,9 +138,16 @@ client_query(struct ntp_peer *p)
if (p->query->fd == -1) {
struct sockaddr *sa = (struct sockaddr *)&p->addr->ss;
- if ((p->query->fd = socket(p->addr->ss.ss_family, SOCK_DGRAM,
- 0)) == -1)
- fatal("client_query socket");
+ p->query->fd = socket(p->addr->ss.ss_family, SOCK_DGRAM, 0);
+ if (p->query->fd == -1) {
+ if (errno == EAFNOSUPPORT) {
+ log_warn("client_query socket");
+ client_nextaddr(p);
+ set_next(p, error_interval());
+ return (-1);
+ } else
+ fatal("client_query socket");
+ }
if (p->rtable != -1 &&
setsockopt(p->query->fd, SOL_SOCKET, SO_RTABLE,
--
2.4.5