Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Dec 1999 09:19:40 -0800 (PST)
From:      John Polstra <jdp@polstra.com>
To:        stable@freebsd.org
Subject:   Re: Route table leaks
Message-ID:  <199912091719.JAA37804@vashon.polstra.com>
In-Reply-To: <199912090458.UAA01426@gndrsh.dnsmgr.net>
References:  <199912090458.UAA01426@gndrsh.dnsmgr.net>

next in thread | previous in thread | raw e-mail | index | archive | help
I have just now committed the fix in -current for the route
table leaks that started this thread.  It is in revision 1.57 of
"src/sys/net/route.c" and it should appear on the mirror sites
within an hour.  Below is the equivalent patch for -stable.  I would
appreciate it if those of you who think you have been experiencing
leaks in -stable would try the patch and let me know whether it
fixes the leaks for you.  If you can let me know within a couple
days then maybe I can persuade Jordan to let me merge it in time for
3.4-RELEASE.

John

Index: route.c
===================================================================
RCS file: /home/ncvs/src/sys/net/route.c,v
retrieving revision 1.50.2.1
diff -u -r1.50.2.1 route.c
--- route.c	1999/08/29 16:28:32	1.50.2.1
+++ route.c	1999/12/09 17:11:57
@@ -87,9 +87,7 @@
 rtalloc(ro)
 	register struct route *ro;
 {
-	if (ro->ro_rt && ro->ro_rt->rt_ifp && (ro->ro_rt->rt_flags & RTF_UP))
-		return;				 /* XXX */
-	ro->ro_rt = rtalloc1(&ro->ro_dst, 1, 0UL);
+	rtalloc_ign(ro, 0UL);
 }
 
 void
@@ -97,8 +95,17 @@
 	register struct route *ro;
 	u_long ignore;
 {
-	if (ro->ro_rt && ro->ro_rt->rt_ifp && (ro->ro_rt->rt_flags & RTF_UP))
-		return;				 /* XXX */
+	struct rtentry *rt;
+	int s;
+
+	if ((rt = ro->ro_rt) != NULL) {
+		if (rt->rt_ifp != NULL && rt->rt_flags & RTF_UP)
+			return;
+		/* XXX - We are probably always at splnet here already. */
+		s = splnet();
+		RTFREE(rt);
+		splx(s);
+	}
 	ro->ro_rt = rtalloc1(&ro->ro_dst, 1, ignore);
 }
 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




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