Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Jun 2012 11:23:56 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r236606 - stable/9/sys/netinet6
Message-ID:  <201206051123.q55BNuac016261@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Tue Jun  5 11:23:56 2012
New Revision: 236606
URL: http://svn.freebsd.org/changeset/base/236606

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

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

Modified: stable/9/sys/netinet6/in6.c
==============================================================================
--- stable/9/sys/netinet6/in6.c	Tue Jun  5 10:23:41 2012	(r236605)
+++ stable/9/sys/netinet6/in6.c	Tue Jun  5 11:23:56 2012	(r236606)
@@ -2236,14 +2236,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?201206051123.q55BNuac016261>