From owner-svn-src-head@freebsd.org Sun Aug 13 00:56:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1CDCDD7314; Sun, 13 Aug 2017 00:56:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B08B47D0CD; Sun, 13 Aug 2017 00:56:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7D0uhQl074670; Sun, 13 Aug 2017 00:56:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7D0uhJo074669; Sun, 13 Aug 2017 00:56:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708130056.v7D0uhJo074669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 13 Aug 2017 00:56:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322449 - head/lib/libcasper/services/cap_dns/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libcasper/services/cap_dns/tests X-SVN-Commit-Revision: 322449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Aug 2017 00:56:45 -0000 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); }