Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Aug 2009 19:15:27 +0000 (UTC)
From:      Qing Li <qingli@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r196152 - head/sys/netinet6
Message-ID:  <200908121915.n7CJFRRu073946@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: qingli
Date: Wed Aug 12 19:15:26 2009
New Revision: 196152
URL: http://svn.freebsd.org/changeset/base/196152

Log:
  A piece of code was added to install a host route when an IPv6 interface
  address is configured with a /128 prefix. This is no longer necessary due
  to r192011. In fact that code conflicts with r192011. This patch removes
  the host route installation when detecting the /128 prefix, and instead
  let the code added by r192011 to install the loopback route for that IPv6
  interface address.
  
  Reviewed by:	bz
  Approved by:	re

Modified:
  head/sys/netinet6/in6.c

Modified: head/sys/netinet6/in6.c
==============================================================================
--- head/sys/netinet6/in6.c	Wed Aug 12 17:45:55 2009	(r196151)
+++ head/sys/netinet6/in6.c	Wed Aug 12 19:15:26 2009	(r196152)
@@ -1750,21 +1750,12 @@ in6_ifinit(struct ifnet *ifp, struct in6
 	 * interface that share the same destination.
 	 */
 	plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */
-	if (!(ia->ia_flags & IFA_ROUTE) && plen == 128) {
-		struct sockaddr *dstaddr;
+	if (!(ia->ia_flags & IFA_ROUTE) && plen == 128 &&
+	    ia->ia_dstaddr.sin6_family == AF_INET6) {
 		int rtflags = RTF_UP | RTF_HOST;
 
-		/* 
-		 * use the interface address if configuring an
-		 * interface address with a /128 prefix len
-		 */
-		if (ia->ia_dstaddr.sin6_family == AF_INET6)
-			dstaddr = (struct sockaddr *)&ia->ia_dstaddr;
-		else
-			dstaddr = (struct sockaddr *)&ia->ia_addr;
-
 		error = rtrequest(RTM_ADD,
-		    (struct sockaddr *)dstaddr,
+		    (struct sockaddr *)&ia->ia_dstaddr,
 		    (struct sockaddr *)&ia->ia_addr,
 		    (struct sockaddr *)&ia->ia_prefixmask,
 		    ia->ia_flags | rtflags, NULL);



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