Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Jul 2009 21:56:23 +0000 (UTC)
From:      Kip Macy <kmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r195624 - head/sys/net
Message-ID:  <200907112156.n6BLuNkZ064283@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kmacy
Date: Sat Jul 11 21:56:23 2009
New Revision: 195624
URL: http://svn.freebsd.org/changeset/base/195624

Log:
  Re-factoring for adding weighted routes introduced a
  fairly irritating bug where the system will panic
  when RADIX_MPATH is enabled. This change fixes this.
  
  Approved by:	re@

Modified:
  head/sys/net/route.c

Modified: head/sys/net/route.c
==============================================================================
--- head/sys/net/route.c	Sat Jul 11 21:46:20 2009	(r195623)
+++ head/sys/net/route.c	Sat Jul 11 21:56:23 2009	(r195624)
@@ -987,7 +987,16 @@ rn_mpath_update(int req, struct rt_addri
 			    (rt->rt_gateway->sa_len != gateway->sa_len ||
 				memcmp(rt->rt_gateway, gateway, gateway->sa_len)))
 				error = ESRCH;
-			goto done;
+			else {
+				/*
+				 * remove from tree before returning it
+				 * to the caller
+				 */
+				rn = rnh->rnh_deladdr(dst, netmask, rnh);
+				KASSERT(rt == RNTORT(rn), ("radix node disappeared"));
+				goto gwdelete;
+			}
+			
 		}
 		/*
 		 * use the normal delete code to remove
@@ -1005,6 +1014,7 @@ rn_mpath_update(int req, struct rt_addri
 	 */
 	if ((req == RTM_DELETE) && !rt_mpath_deldup(rto, rt))
 		panic ("rtrequest1: rt_mpath_deldup");
+gwdelete:
 	RT_LOCK(rt);
 	RT_ADDREF(rt);
 	if (req == RTM_DELETE) {



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