From owner-svn-src-head@FreeBSD.ORG Sun Sep 8 19:40:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AF9896BF; Sun, 8 Sep 2013 19:40:33 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C2B72D4C; Sun, 8 Sep 2013 19:40:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r88JeXoB010947; Sun, 8 Sep 2013 19:40:33 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r88JeX4x010945; Sun, 8 Sep 2013 19:40:33 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201309081940.r88JeX4x010945@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 8 Sep 2013 19:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255403 - in head: contrib/ldns-host usr.bin/host X-SVN-Group: head 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.14 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, 08 Sep 2013 19:40:33 -0000 Author: des Date: Sun Sep 8 19:40:32 2013 New Revision: 255403 URL: http://svnweb.freebsd.org/changeset/base/255403 Log: Import Magerya Vitaly's ldns-host, and build it instead of the BIND version in the WITH_LDNS_UTILS case. Approved by: re (blanket) Added: head/contrib/ldns-host/ - copied from r255390, vendor/ldns-host/dist/ Modified: head/contrib/ldns-host/ldns-host.c head/usr.bin/host/Makefile Modified: head/contrib/ldns-host/ldns-host.c ============================================================================== --- vendor/ldns-host/dist/ldns-host.c Sun Sep 8 15:44:34 2013 (r255390) +++ head/contrib/ldns-host/ldns-host.c Sun Sep 8 19:40:32 2013 (r255403) @@ -7,13 +7,16 @@ * without any warranty. */ -#include +#include + #include #include #include #include #include +#include + /* General utilities. */ @@ -198,11 +201,11 @@ ldns_pkt_filter_answer(ldns_pkt *pkt, ld rrtype = ldns_rr_get_type(rr); if (type == LDNS_RR_TYPE_ANY || type == rrtype || - type == LDNS_RR_TYPE_AXFR && + (type == LDNS_RR_TYPE_AXFR && (rrtype == LDNS_RR_TYPE_A || - rrtype == LDNS_RR_TYPE_AAAA || - rrtype == LDNS_RR_TYPE_NS || - rrtype == LDNS_RR_TYPE_PTR)) + rrtype == LDNS_RR_TYPE_AAAA || + rrtype == LDNS_RR_TYPE_NS || + rrtype == LDNS_RR_TYPE_PTR))) ldns_rr_list_set_rr(rrlist, rr, j++); } ldns_rr_list_set_rr_count(rrlist, j); @@ -458,8 +461,8 @@ static uint32_t o_ixfr_serial = 0; static void usage(void) { fputs( - "Usage: ldns-host [-aCdilrsTvw46] [-c class] [-N ndots] [-R number]\n" - " [-t type] [-W wait] name [server]\n" + "Usage: host [-aCdilrsTvw46] [-c class] [-N ndots] [-R number]\n" + " [-t type] [-W wait] name [server]\n" "\t-a same as -v -t ANY\n" "\t-C query SOA records from all authoritative name servers\n" "\t-c use this query class (IN, CH, HS, etc)\n" @@ -776,10 +779,10 @@ dosoa(ldns_resolver *res, ldns_rdf *doma for (j = 0; j < cnt; j++) { ldns_resolver_remove_nameservers(res); rr = ldns_rr_list_rr(nsaddrs[i], j); - if (ldns_resolver_ip6(res) == LDNS_RESOLV_INET && - ldns_rr_get_type(rr) == LDNS_RR_TYPE_AAAA || - ldns_resolver_ip6(res) == LDNS_RESOLV_INET6 && - ldns_rr_get_type(rr) == LDNS_RR_TYPE_A) + if ((ldns_resolver_ip6(res) == LDNS_RESOLV_INET && + ldns_rr_get_type(rr) == LDNS_RR_TYPE_AAAA) || + (ldns_resolver_ip6(res) == LDNS_RESOLV_INET6 && + ldns_rr_get_type(rr) == LDNS_RR_TYPE_A)) continue; if (ldns_resolver_push_nameserver_rr(res, rr) == LDNS_STATUS_OK) /* bind9-host queries for domain, not dname here */ Modified: head/usr.bin/host/Makefile ============================================================================== --- head/usr.bin/host/Makefile Sun Sep 8 19:39:18 2013 (r255402) +++ head/usr.bin/host/Makefile Sun Sep 8 19:40:32 2013 (r255403) @@ -1,5 +1,29 @@ # $FreeBSD$ +.include + +.if ${MK_LDNS_UTILS} != "no" + +LDNSDIR= ${.CURDIR}/../../contrib/ldns +LDNSHOSTDIR= ${.CURDIR}/../../contrib/ldns-host + +.PATH: ${LDNSHOSTDIR} + +PROG= host +SRCS= ldns-host.c +MAN= host.1 + +host.1: ldns-host.1 + sed -e 's/ldns-//gI' <${.ALLSRC} >${.TARGET} || \ + (rm -rf ${.TARGET} ; false) + +CFLAGS+= -I${LDNSDIR} +DPADD+= ${LIBLDNS} ${LIBCRYPTO} +LDADD+= -lldns -lcrypto +USEPRIVATELIB= ldns + +.else + BIND_DIR= ${.CURDIR}/../../contrib/bind9 LIB_BIND_REL= ../../lib/bind LIB_BIND_DIR= ${.CURDIR}/${LIB_BIND_REL} @@ -20,4 +44,6 @@ WARNS?= 0 DPADD+= ${BIND_DPADD} ${CRYPTO_DPADD} ${PTHREAD_DPADD} LDADD+= ${BIND_LDADD} ${CRYPTO_LDADD} ${PTHREAD_LDADD} +.endif + .include