From owner-svn-src-all@FreeBSD.ORG Sun Oct 12 16:58:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B860E27F; Sun, 12 Oct 2014 16:58:46 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2571D5C; Sun, 12 Oct 2014 16:58:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9CGwkMm053667; Sun, 12 Oct 2014 16:58:46 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9CGwkPQ053666; Sun, 12 Oct 2014 16:58:46 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201410121658.s9CGwkPQ053666@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 12 Oct 2014 16:58:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272989 - stable/10/contrib/ipfilter/tools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Oct 2014 16:58:46 -0000 Author: cy Date: Sun Oct 12 16:58:45 2014 New Revision: 272989 URL: https://svnweb.freebsd.org/changeset/base/272989 Log: MFC r271977 3561691 gethost never returns an ipv6 address Obtained from: ipfilter CVS repo (r1.34), netbsd CVS repo (r1.4) Modified: stable/10/contrib/ipfilter/tools/ipnat_y.y Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ipfilter/tools/ipnat_y.y ============================================================================== --- stable/10/contrib/ipfilter/tools/ipnat_y.y Sun Oct 12 16:55:26 2014 (r272988) +++ stable/10/contrib/ipfilter/tools/ipnat_y.y Sun Oct 12 16:58:45 2014 (r272989) @@ -1164,17 +1164,19 @@ hexnumber: hostname: YY_STR { i6addr_t addr; + int family; +#ifdef USE_INET6 + if (nat->in_v[0] == 6) + family = AF_INET6; + else +#endif + family = AF_INET; bzero(&$$, sizeof($$)); - if (gethost(AF_INET, $1, - &addr) == 0) { - $$.a = addr; - $$.f = AF_INET; - } else - if (gethost(AF_INET6, $1, + $$.f = family; + if (gethost(family, $1, &addr) == 0) { $$.a = addr; - $$.f = AF_INET6; } else { FPRINTF(stderr, "Unknown host '%s'\n",