Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Aug 2009 19:04:22 +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-7@freebsd.org
Subject:   svn commit: r196549 - in stable/7/sys: . contrib/pf netinet6
Message-ID:  <200908251904.n7PJ4MHP036760@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Tue Aug 25 19:04:22 2009
New Revision: 196549
URL: http://svn.freebsd.org/changeset/base/196549

Log:
  MFC r187946:
    Like with r185713 make sure to not leak a lock as rtalloc1(9) returns
    a locked route. Thus we have to use RTFREE_LOCKED(9) to get it unlocked
    and rtfree(9)d rather than just rtfree(9)d.
  
    PR:		kern/129793
    Submitted by:	Dheeraj Reddy <dheeraj@ece.gatech.edu>
    Originally committed from:       Bugathon #6

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/netinet6/in6_gif.c
  stable/7/sys/netinet6/in6_ifattach.c
  stable/7/sys/netinet6/nd6_nbr.c

Modified: stable/7/sys/netinet6/in6_gif.c
==============================================================================
--- stable/7/sys/netinet6/in6_gif.c	Tue Aug 25 17:00:24 2009	(r196548)
+++ stable/7/sys/netinet6/in6_gif.c	Tue Aug 25 19:04:22 2009	(r196549)
@@ -389,10 +389,10 @@ gif_validate6(const struct ip6_hdr *ip6,
 			    ip6_sprintf(ip6buf, &sin6.sin6_addr));
 #endif
 			if (rt)
-				rtfree(rt);
+				RTFREE_LOCKED(rt);
 			return 0;
 		}
-		rtfree(rt);
+		RTFREE_LOCKED(rt);
 	}
 
 	return 128 * 2;

Modified: stable/7/sys/netinet6/in6_ifattach.c
==============================================================================
--- stable/7/sys/netinet6/in6_ifattach.c	Tue Aug 25 17:00:24 2009	(r196548)
+++ stable/7/sys/netinet6/in6_ifattach.c	Tue Aug 25 19:04:22 2009	(r196549)
@@ -767,7 +767,7 @@ in6_ifdetach(struct ifnet *ifp)
 		if ((ia->ia_flags & IFA_ROUTE) &&
 		    (rt = rtalloc1((struct sockaddr *)&ia->ia_addr, 0, 0UL))) {
 			rtflags = rt->rt_flags;
-			rtfree(rt);
+			RTFREE_LOCKED(rt);
 			rtrequest(RTM_DELETE, (struct sockaddr *)&ia->ia_addr,
 			    (struct sockaddr *)&ia->ia_addr,
 			    (struct sockaddr *)&ia->ia_prefixmask,

Modified: stable/7/sys/netinet6/nd6_nbr.c
==============================================================================
--- stable/7/sys/netinet6/nd6_nbr.c	Tue Aug 25 17:00:24 2009	(r196548)
+++ stable/7/sys/netinet6/nd6_nbr.c	Tue Aug 25 19:04:22 2009	(r196549)
@@ -236,7 +236,7 @@ nd6_ns_input(struct mbuf *m, int off, in
 		need_proxy = (rt && (rt->rt_flags & RTF_ANNOUNCE) != 0 &&
 		    rt->rt_gateway->sa_family == AF_LINK);
 		if (rt)
-			rtfree(rt);
+			RTFREE_LOCKED(rt);
 		if (need_proxy) {
 			/*
 			 * proxy NDP for single entry



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