From owner-freebsd-arch Tue Dec 14 15:28:26 1999 Delivered-To: freebsd-arch@freebsd.org Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (Postfix) with ESMTP id 2643515347 for ; Tue, 14 Dec 1999 15:28:22 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.3/8.9.3) with ESMTP id AAA09866 for ; Wed, 15 Dec 1999 00:28:20 +0100 (CET) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id AAA66757 for freebsd-arch@freebsd.org; Wed, 15 Dec 1999 00:28:19 +0100 (MET) Received: from awfulhak.org (dynamic-24.max4-du-ws.dialnetwork.pavilion.co.uk [212.74.9.152]) by hub.freebsd.org (Postfix) with ESMTP id 7A8C214E8C for ; Tue, 14 Dec 1999 15:26:12 -0800 (PST) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (root@hak.lan.Awfulhak.org [172.16.0.12]) by awfulhak.org (8.9.3/8.9.3) with ESMTP id XAA32039; Tue, 14 Dec 1999 23:20:41 GMT (envelope-from brian@lan.awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost.lan.Awfulhak.org [127.0.0.1]) by hak.lan.Awfulhak.org (8.9.3/8.9.3) with ESMTP id XAA36949; Tue, 14 Dec 1999 23:22:15 GMT (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <199912142322.XAA36949@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.1.0 09/18/1999 To: Jonathan Lemon Cc: Brian Somers , Warner Losh , freebsd-arch@freebsd.org, brian@hak.lan.Awfulhak.org, brian@hak.lan.Awfulhak.org Subject: Re: The if_detach problem In-Reply-To: Message from Jonathan Lemon of "Tue, 14 Dec 1999 16:04:54 CST." <19991214160454.26093@right.PCS> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 14 Dec 1999 23:22:15 +0000 From: Brian Somers Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > On Dec 12, 1999 at 09:45:36PM +0000, Brian Somers wrote: > > > > > > if_detach doesn't, at least not completely. > > > > > > That's a problem when you want to remove interfaces. One problem is > > > that the routing system caches ifaddr and other things. There is a > > > mechanism in place that could be used to clean things up. > > > > > > In the protosw there is a ctlinput routine which accepts various > > > commands. One way to deal with this is to send a new command when ifa > > > goes away. Right now when we do if_down we send a PRC_IFDOWN. Maybe > > > we need to invent a new PRC_, say PRC_IFDETACH. Then we wouldn't need > > > the kludges in if_detach. The ctlinput routines could then, in the > > > appropriate places, scrub the references to the interface that just > > > went away. > > > > > > I'd like to go down this path, any comments? > > > > Not comments, but my thoughts.... > > > > Is there a lot to be gained by removing interfaces ? > > Loadable device drivers. I ran into this last week or so when > unloading a driver I'm developing; if I don't do an 'ifconfig xxx delete' > before the kldunoad, I get a panic. Right, but how about a ``notthere'' flag instead ? My concern is that there are some APIs that use interface ids (sysctl(PF_ROUTE) springs to mind) and some APIs that use interface names (the struct ifaliasreq ioctls etc) and reassigning the association between the two on the fly seems a tad dangerous - lots of races. Another (more real?) argument for keeping the interface but making it unusable 'till the driver wants it again is that there may be security concerns.... at the moment, ``netstat -i'' reports what's been going on very nicely. Removing the interface entirely will allow people to hide what should not be hidden.... > -- > Jonathan -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message