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.4 KiB

5 years ago
5 years ago
7 years ago
7 years ago
5 years ago
  1. From 5ad3e4de4bedeeff0751b44a85032f48b9b6452c 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/15] 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 3de52685b1..aa9fc24c68 100644
  14. --- a/src/usr.sbin/ntpd/client.c
  15. +++ b/src/usr.sbin/ntpd/client.c
  16. @@ -140,9 +140,16 @@ client_query(struct ntp_peer *p)
  17. struct sockaddr *qa4 = (struct sockaddr *)&p->query_addr4;
  18. struct sockaddr *qa6 = (struct sockaddr *)&p->query_addr6;
  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 (p->addr->ss.ss_family == qa4->sa_family) {
  33. if (bind(p->query->fd, qa4, SA_LEN(qa4)) == -1)
  34. --
  35. 2.21.0