Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 May 2012 20:02:39 +0000 (UTC)
From:      Maksim Yevmenkin <emax@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r236327 - head/sys/netinet6
Message-ID:  <201205302002.q4UK2d5T071803@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emax
Date: Wed May 30 20:02:39 2012
New Revision: 236327
URL: http://svn.freebsd.org/changeset/base/236327

Log:
  When we return deprecated addresses, we need to reference them.
  
  Reviewed by:	bz, scottl
  MFC after:	3 days

Modified:
  head/sys/netinet6/in6.c

Modified: head/sys/netinet6/in6.c
==============================================================================
--- head/sys/netinet6/in6.c	Wed May 30 19:21:54 2012	(r236326)
+++ head/sys/netinet6/in6.c	Wed May 30 20:02:39 2012	(r236327)
@@ -2265,14 +2265,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;
 }
 



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