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

  1. From 7e3c2f022bd8f008d6db389c06b340972d3e0cc8 Mon Sep 17 00:00:00 2001
  2. From: Brent Cook <busterb@gmail.com>
  3. Date: Tue, 30 Dec 2014 09:10:22 -0600
  4. Subject: [PATCH 01/12] Handle IPv6 DNS records on IPv4 networks more liberally
  5. Rather than fail on IPv4 only networks when seeing an IPv6 DNS record,
  6. just give a warning.
  7. Debian bug ID: 500676.
  8. Original Author: Stefan Praszalowicz <stefan.praszalowicz@avedya.com>
  9. ---
  10. src/usr.sbin/ntpd/client.c | 13 ++++++++++---
  11. 1 file changed, 10 insertions(+), 3 deletions(-)
  12. diff --git a/src/usr.sbin/ntpd/client.c b/src/usr.sbin/ntpd/client.c
  13. index a92382b..7ce3b38 100644
  14. --- a/src/usr.sbin/ntpd/client.c
  15. +++ b/src/usr.sbin/ntpd/client.c
  16. @@ -138,9 +138,16 @@ client_query(struct ntp_peer *p)
  17. if (p->query->fd == -1) {
  18. struct sockaddr *sa = (struct sockaddr *)&p->addr->ss;
  19. - if ((p->query->fd = socket(p->addr->ss.ss_family, SOCK_DGRAM,
  20. - 0)) == -1)
  21. - fatal("client_query socket");
  22. + p->query->fd = socket(p->addr->ss.ss_family, SOCK_DGRAM, 0);
  23. + if (p->query->fd == -1) {
  24. + if (errno == EAFNOSUPPORT) {
  25. + log_warn("client_query socket");
  26. + client_nextaddr(p);
  27. + set_next(p, error_interval());
  28. + return (-1);
  29. + } else
  30. + fatal("client_query socket");
  31. + }
  32. if (connect(p->query->fd, sa, SA_LEN(sa)) == -1) {
  33. if (errno == ECONNREFUSED || errno == ENETUNREACH ||
  34. --
  35. 2.6.3