svn commit: r272989 - stable/10/contrib/ipfilter/tools

Cy Schubert cy at FreeBSD.org
Sun Oct 12 16:58:46 UTC 2014


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",


More information about the svn-src-all mailing list