svn commit: r236607 - stable/8/sys/netinet6

Bjoern A. Zeeb bz at FreeBSD.org
Tue Jun 5 11:24:06 UTC 2012


Author: bz
Date: Tue Jun  5 11:24:05 2012
New Revision: 236607
URL: http://svn.freebsd.org/changeset/base/236607

Log:
  MFC r236327 (by emax):
  
    When we return deprecated addresses, we need to reference them.

Modified:
  stable/8/sys/netinet6/in6.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/netinet6/in6.c
==============================================================================
--- stable/8/sys/netinet6/in6.c	Tue Jun  5 11:23:56 2012	(r236606)
+++ stable/8/sys/netinet6/in6.c	Tue Jun  5 11:24:05 2012	(r236607)
@@ -2151,14 +2151,20 @@ in6_ifawithifp(struct ifnet *ifp, struct
 		IF_ADDR_RUNLOCK(ifp);
 		return (struct in6_ifaddr *)ifa;
 	}
-	IF_ADDR_RUNLOCK(ifp);
 
 	/* use the last-resort values, that are, deprecated addresses */
-	if (dep[0])
+	if (dep[0]) {
+		ifa_ref((struct ifaddr *)dep[0]);
+		IF_ADDR_RUNLOCK(ifp);
 		return dep[0];
-	if (dep[1])
+	}
+	if (dep[1]) {
+		ifa_ref((struct ifaddr *)dep[1]);
+		IF_ADDR_RUNLOCK(ifp);
 		return dep[1];
+	}
 
+	IF_ADDR_RUNLOCK(ifp);
 	return NULL;
 }
 


More information about the svn-src-stable-8 mailing list