From owner-cvs-src@FreeBSD.ORG Sat Aug 27 02:42:24 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7A5AB16A41F; Sat, 27 Aug 2005 02:42:24 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [204.156.12.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B61A43D46; Sat, 27 Aug 2005 02:42:23 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by cyrus.watson.org (Postfix) with ESMTP id 0475246C40; Fri, 26 Aug 2005 22:42:23 -0400 (EDT) Date: Sat, 27 Aug 2005 03:42:22 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Andrew Thompson In-Reply-To: <200508270117.j7R1Hgkw003979@repoman.freebsd.org> Message-ID: <20050827033842.M33851@fledge.watson.org> References: <200508270117.j7R1Hgkw003979@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/net if_bridge.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Aug 2005 02:42:24 -0000 On Sat, 27 Aug 2005, Andrew Thompson wrote: > Fix a panic in softclock() if the interface is destroyed with a bpf > consumer > attached. > > This is caused by bpf_detachd clearing IFF_PROMISC on the interface which does > a SIOCSIFFLAGS ioctl. The problem here is that while the interface has been > stopped, IFF_UP has not been cleared so IFF_UP != IFF_DRV_RUNNING, this causes > the ioctl function to init() the interface which resets the callouts. > > The destroy then completes and frees the softc but softclock will panic on a > dead callout pointer. > > Ensure ifp->if_flags matches reality by clearing IFF_UP when we destroy. > > Silence from: rwatson > Approved by: mlaier (mentor) > MFC after: 3 days Sorry about not yet having gotten around to responding to your e-mail -- I've been on travel for the last couple of weeks, having spent quality time in Heathrow courtesy BA, but hope to look more closely at this and related issues in the near future. One particular long-term concern I have is with respect to modification of IFF_UP state, which for most device drivers is an administrative condition, rather than a link condition. Certain connection-oriented drivers, such as PPP, modify IFF_UP. So do some ethernet interfaces, under the possibly mistaken impression that that is necessary to raise the interface when it is configured. I've not yet had a chance to investigate what the right approach is, but in the long term, we will need to resolve who "owns" the field, be it the stack or the device driver, and how event notifications are handled. I suspect some use of IFF_UP by device drivers will eventually become a separate driver-owned flag, possibly in softc, which will reflect the driver's state transitions to reflect administrator-requested up/down state. Robert N M Watson