From owner-svn-src-head@FreeBSD.ORG Sat Jul 11 21:56:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF3AF106564A; Sat, 11 Jul 2009 21:56:23 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDDA28FC18; Sat, 11 Jul 2009 21:56:23 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6BLuNiM064285; Sat, 11 Jul 2009 21:56:23 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6BLuNkZ064283; Sat, 11 Jul 2009 21:56:23 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200907112156.n6BLuNkZ064283@svn.freebsd.org> From: Kip Macy Date: Sat, 11 Jul 2009 21:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195624 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Jul 2009 21:56:24 -0000 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) {