svn commit: r226453 - head/sys/netinet6

Qing Li qingli at FreeBSD.org
Sun Oct 16 22:24:05 UTC 2011


Author: qingli
Date: Sun Oct 16 22:24:04 2011
New Revision: 226453
URL: http://svn.freebsd.org/changeset/base/226453

Log:
  The code change made in r226040 was incomplete and resulted in
  routes such as fe80::1%lo0 no being installed. This patch completes
  the original intended fix.
  
  Reviewed by:	hrs, bz
  MFC after:	3 days

Modified:
  head/sys/netinet6/in6.c

Modified: head/sys/netinet6/in6.c
==============================================================================
--- head/sys/netinet6/in6.c	Sun Oct 16 22:18:08 2011	(r226452)
+++ head/sys/netinet6/in6.c	Sun Oct 16 22:24:04 2011	(r226453)
@@ -1860,14 +1860,17 @@ in6_ifinit(struct ifnet *ifp, struct in6
 		if (error != 0)
 			return (error);
 		ia->ia_flags |= IFA_ROUTE;
+		/*
+		 * Handle the case for ::1 .
+		 */
+		if (ifp->if_flags & IFF_LOOPBACK)
+			ia->ia_flags |= IFA_RTSELF;
 	}
 
 	/*
 	 * add a loopback route to self
 	 */
-	if (!(ia->ia_flags & IFA_RTSELF)
-	    && (V_nd6_useloopback
-		&& !(ifp->if_flags & IFF_LOOPBACK))) {
+	if (!(ia->ia_flags & IFA_RTSELF) && V_nd6_useloopback) {
 		error = ifa_add_loopback_route((struct ifaddr *)ia,
 				       (struct sockaddr *)&ia->ia_addr);
 		if (error == 0)


More information about the svn-src-all mailing list