From owner-freebsd-current@FreeBSD.ORG Thu Apr 10 05:51:44 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 ADC3537B401; Thu, 10 Apr 2003 05:51:44 -0700 (PDT) Received: from mta7.pltn13.pbi.net (mta7.pltn13.pbi.net [64.164.98.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3486243FBD; Thu, 10 Apr 2003 05:51:44 -0700 (PDT) (envelope-from hsu@FreeBSD.org) Received: from FreeBSD.org (adsl-63-193-112-125.dsl.snfc21.pacbell.net [63.193.112.125])h3ACphHo021011; Thu, 10 Apr 2003 05:51:43 -0700 (PDT) Message-Id: <200304101251.h3ACphHo021011@mta7.pltn13.pbi.net> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: harti@FreeBSD.org In-Reply-To: Message from Harti Brandt <20030410143518.B605@beagle.fokus.fraunhofer.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 10 Apr 2003 05:53:11 -0700 From: Jeffrey Hsu 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 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:51:45 -0000 > I must stop the interface before calling if_detach. The midway driver doesn't do that now anyways, so there's no reason to start now. > If I unlock after stoping before detaching, I get a race window > where somebody could just UP the interface. This race is outside the scope of the network driver lock. > 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? That's what I had planned. Jeffrey