From owner-freebsd-current@FreeBSD.ORG Wed Jul 27 21:48:26 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7FB7716A420; Wed, 27 Jul 2005 21:48:26 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from rwcrmhc12.comcast.net (rwcrmhc14.comcast.net [216.148.227.89]) by mx1.FreeBSD.org (Postfix) with ESMTP id C8CD943D49; Wed, 27 Jul 2005 21:48:25 +0000 (GMT) (envelope-from rodrigc@crodrigues.org) Received: from c-66-30-114-143.hsd1.ma.comcast.net ([66.30.114.143]) by comcast.net (rwcrmhc14) with ESMTP id <20050727214822014001ve40e>; Wed, 27 Jul 2005 21:48:23 +0000 Received: from c-66-30-114-143.hsd1.ma.comcast.net (localhost.127.in-addr.arpa [127.0.0.1]) by c-66-30-114-143.hsd1.ma.comcast.net (8.13.4/8.13.1) with ESMTP id j6RLmL0W001133; Wed, 27 Jul 2005 17:48:21 -0400 (EDT) (envelope-from rodrigc@c-66-30-114-143.hsd1.ma.comcast.net) Received: (from rodrigc@localhost) by c-66-30-114-143.hsd1.ma.comcast.net (8.13.4/8.13.1/Submit) id j6RLmK59001132; Wed, 27 Jul 2005 17:48:20 -0400 (EDT) (envelope-from rodrigc) Date: Wed, 27 Jul 2005 17:48:20 -0400 From: Craig Rodrigues To: Robert Watson Message-ID: <20050727214820.GA1123@crodrigues.org> References: <20050726124222.GA1109@crodrigues.org> <20050726131712.GC46538@darkness.comp.waw.pl> <20050726145334.GA1826@crodrigues.org> <20050727223351.A54330@fledge.watson.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050727223351.A54330@fledge.watson.org> User-Agent: Mutt/1.5.9i Cc: freebsd-current@FreeBSD.org, Harti Brandt Subject: Re: Panic in netnatm X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2005 21:48:26 -0000 On Wed, Jul 27, 2005 at 10:35:34PM +0100, Robert Watson wrote: > Otherwise, this looks good to me! (And I guess neither Harti or Bruce got > a chance to test these code paths?) Harti is on vacation until the end of August so I received no feedback from him. I updated my patch based on your comments. What do you think? --- if_atm.c.orig Tue Jul 26 10:28:42 2005 +++ if_atm.c Wed Jul 27 17:44:45 2005 @@ -221,6 +221,7 @@ * let native ATM know we are using this VCI/VPI * (i.e. reserve it) */ + NATM_LOCK(); sin = (struct sockaddr_in *) rt_key(rt); if (sin->sin_family != AF_INET) goto failed; @@ -256,6 +257,7 @@ rt->rt_llinfo = NULL; rt->rt_flags &= ~RTF_LLINFO; } + NATM_UNLOCK(); #endif /* mark as invalid. We cannot RTM_DELETE the route from * here, because the recursive call to rtrequest1 does @@ -269,10 +271,12 @@ * tell native ATM we are done with this VC */ if (rt->rt_flags & RTF_LLINFO) { + NATM_LOCK(); npcb_free((struct natmpcb *)rt->rt_llinfo, NPCB_DESTROY); rt->rt_llinfo = NULL; rt->rt_flags &= ~RTF_LLINFO; + NATM_UNLOCK(); } #endif /* -- Craig Rodrigues rodrigc@crodrigues.org