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 1f533ce93b5826f3c3e3b16b237571c9c62dc1eb 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 03/13] 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 3ae2c18..9a499b1 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 (p->rtable != -1 &&
  33. setsockopt(p->query->fd, SOL_SOCKET, SO_RTABLE,
  34. --
  35. 1.9.1