svn commit: r245225 - head/lib/libc/net

Hajimu UMEMOTO ume at FreeBSD.org
Wed Jan 9 15:22:38 UTC 2013


Author: ume
Date: Wed Jan  9 15:22:37 2013
New Revision: 245225
URL: http://svnweb.freebsd.org/changeset/base/245225

Log:
  Disable destination address selection support of
  getipnodebyname(1).  RFC 2553 mentions IPv6 addresses
  are returned 1st.
  
  Spotted by:	uqs
  MFC after:	1 week

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

Modified: head/lib/libc/net/name6.c
==============================================================================
--- head/lib/libc/net/name6.c	Wed Jan  9 11:58:47 2013	(r245224)
+++ head/lib/libc/net/name6.c	Wed Jan  9 15:22:37 2013	(r245225)
@@ -200,6 +200,7 @@ static struct	 hostent *_hpmapv6(struct 
 #endif
 static struct	 hostent *_hpsort(struct hostent *, res_state);
 
+#ifdef ENABLE_IP6ADDRCTL
 static struct	 hostent *_hpreorder(struct hostent *);
 static int	 get_addrselectpolicy(struct policyhead *);
 static void	 free_addrselectpolicy(struct policyhead *);
@@ -209,6 +210,7 @@ static void	 set_source(struct hp_order 
 static int	 matchlen(struct sockaddr *, struct sockaddr *);
 static int	 comp_dst(const void *, const void *);
 static int	 gai_addr2scopetype(struct sockaddr *);
+#endif
 
 /*
  * Functions defined in RFC2553
@@ -309,7 +311,11 @@ 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 *
@@ -632,6 +638,7 @@ _hpsort(struct hostent *hp, res_state st
 	return hp;
 }
 
+#ifdef ENABLE_IP6ADDRCTL
 /*
  * _hpreorder: sort address by default address selection
  */
@@ -1109,3 +1116,4 @@ gai_addr2scopetype(struct sockaddr *sa)
 		return(-1);
 	}
 }
+#endif


More information about the svn-src-head mailing list