From owner-freebsd-current@FreeBSD.ORG Thu Apr 10 05:40:14 2003 Return-Path: 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 1C8AC37B401; Thu, 10 Apr 2003 05:40:14 -0700 (PDT) Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9593243F3F; Thu, 10 Apr 2003 05:40:11 -0700 (PDT) (envelope-from brandt@fokus.fraunhofer.de) Received: from beagle (beagle [193.175.132.100])h3ACe9E02405; Thu, 10 Apr 2003 14:40:09 +0200 (MEST) Date: Thu, 10 Apr 2003 14:40:09 +0200 (CEST) From: Harti Brandt To: Jeffrey Hsu In-Reply-To: <200304101219.h3ACJDHo011225@mta7.pltn13.pbi.net> Message-ID: <20030410143518.B605@beagle.fokus.fraunhofer.de> References: <200304101219.h3ACJDHo011225@mta7.pltn13.pbi.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-current@FreeBSD.org Subject: Re: LOR in if_detach X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: harti@FreeBSD.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2003 12:40:14 -0000 On Thu, 10 Apr 2003, Jeffrey Hsu wrote: JH> > is there any insight on how to avoid an LOR in if_detach? JH> JH>Call if_detach() before you acquire the driver lock. I must stop the interface before calling if_detach. To stop it I need the lock. If I unlock after stoping before detaching, I get a race window where somebody could just UP the interface. While thinking about, it seems, that having a lock in struct ifnet would make sense in the long run. How can we otherwise ensure, that nobody is calling if_ioctl while we are detaching the interface? Hmmm... harti -- harti brandt, http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.fraunhofer.de, harti@freebsd.org