Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Oct 2014 16:58:46 +0000 (UTC)
From:      Cy Schubert <cy@FreeBSD.org>
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
Message-ID:  <201410121658.s9CGwkPQ053666@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410121658.s9CGwkPQ053666>