Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jan 2013 14:08:19 +0000 (UTC)
From:      Hajimu UMEMOTO <ume@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r245256 - head/lib/libc/net
Message-ID:  <201301101408.r0AE8J73014053@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ume
Date: Thu Jan 10 14:08:19 2013
New Revision: 245256
URL: http://svnweb.freebsd.org/changeset/base/245256

Log:
  Re-enable ip6addrctl support but only for IPv6 address.
  
  Requested by:	Ben Morrow <ben__at__morrow.me.uk>
  MFC after:	1 week

Modified:
  head/lib/libc/net/name6.c

Modified: head/lib/libc/net/name6.c
==============================================================================
--- head/lib/libc/net/name6.c	Thu Jan 10 12:43:58 2013	(r245255)
+++ head/lib/libc/net/name6.c	Thu Jan 10 14:08:19 2013	(r245256)
@@ -200,7 +200,7 @@ static struct	 hostent *_hpmapv6(struct 
 #endif
 static struct	 hostent *_hpsort(struct hostent *, res_state);
 
-#ifdef ENABLE_IP6ADDRCTL
+#ifdef INET6
 static struct	 hostent *_hpreorder(struct hostent *);
 static int	 get_addrselectpolicy(struct policyhead *);
 static void	 free_addrselectpolicy(struct policyhead *);
@@ -287,8 +287,10 @@ getipnodebyname(const char *name, int af
 	
 	hp = gethostbyname2(name, af);
 	hp = _hpcopy(hp, errp);
-
 #ifdef INET6
+	if (af == AF_INET6)
+		hp = _hpreorder(hp);
+
 	if (af == AF_INET6 && ((flags & AI_ALL) || hp == NULL) &&
 	    MAPADDRENABLED(flags)) {
 		struct hostent *hp2 = gethostbyname2(name, AF_INET);
@@ -311,11 +313,7 @@ getipnodebyname(const char *name, int af
 		*errp = statp->res_h_errno;
 	
 	statp->options = options;
-#ifdef ENABLE_IP6ADDRCTL
-	return _hpreorder(_hpsort(hp, statp));
-#else
 	return _hpsort(hp, statp);
-#endif
 }
 
 struct hostent *
@@ -638,7 +636,7 @@ _hpsort(struct hostent *hp, res_state st
 	return hp;
 }
 
-#ifdef ENABLE_IP6ADDRCTL
+#ifdef INET6
 /*
  * _hpreorder: sort address by default address selection
  */



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