Author: ngie
Date: Sun Aug 13 00:56:43 2017
New Revision: 322449
URL: https://svnweb.freebsd.org/changeset/base/322449

Log:
  Use hardcoded IPv4/IPv6 addresses for google-public-dns-a.google.com instead
  of freefall.freebsd.org to unbreak the DNS tests
  
  The address allocations for freefall.freebsd.org have changed in the past 4 
years.
  Use a more stable set of hardcoded addresses for now to make the tests succeed
  reliably.
  
  The hostname should be resolved dynamically instead of hardcoding the 
addresses in
  the future. This is just a bandaid.
  
  MFC after:    1 week

Modified:
  head/lib/libcasper/services/cap_dns/tests/dns_test.c

Modified: head/lib/libcasper/services/cap_dns/tests/dns_test.c
==============================================================================
--- head/lib/libcasper/services/cap_dns/tests/dns_test.c        Sun Aug 13 
00:14:08 2017        (r322448)
+++ head/lib/libcasper/services/cap_dns/tests/dns_test.c        Sun Aug 13 
00:56:43 2017        (r322449)
@@ -297,32 +297,26 @@ runtest(cap_channel_t *capdns)
                freeaddrinfo(aic);
        }
 
-       /*
-        * 8.8.178.135 is IPv4 address of freefall.freebsd.org
-        * as of 27 October 2013.
-        */
-       inet_pton(AF_INET, "8.8.178.135", &ip4);
+       /* XXX: hardcoded addresses for "google-public-dns-a.google.com". */
+#define        GOOGLE_DNS_IPV4 "8.8.8.8"
+#define        GOOGLE_DNS_IPV6 "2001:4860:4860::8888"
+
+       inet_pton(AF_INET, GOOGLE_DNS_IPV4, &ip4);
        hps = gethostbyaddr(&ip4, sizeof(ip4), AF_INET);
        if (hps == NULL)
-               fprintf(stderr, "Unable to resolve %s.\n", "8.8.178.135");
+               fprintf(stderr, "Unable to resolve %s.\n", GOOGLE_DNS_IPV4);
        hpc = cap_gethostbyaddr(capdns, &ip4, sizeof(ip4), AF_INET);
        if (hostent_compare(hps, hpc))
                result |= GETHOSTBYADDR_AF_INET;
 
-       /*
-        * 2001:1900:2254:206c::16:87 is IPv6 address of freefall.freebsd.org
-        * as of 27 October 2013.
-        */
-       inet_pton(AF_INET6, "2001:1900:2254:206c::16:87", &ip6);
+       inet_pton(AF_INET6, GOOGLE_DNS_IPV6, &ip6);
        hps = gethostbyaddr(&ip6, sizeof(ip6), AF_INET6);
        if (hps == NULL) {
-               fprintf(stderr, "Unable to resolve %s.\n",
-                   "2001:1900:2254:206c::16:87");
+               fprintf(stderr, "Unable to resolve %s.\n", GOOGLE_DNS_IPV6);
        }
        hpc = cap_gethostbyaddr(capdns, &ip6, sizeof(ip6), AF_INET6);
        if (hostent_compare(hps, hpc))
                result |= GETHOSTBYADDR_AF_INET6;
-
        return (result);
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to