From owner-freebsd-arch Mon Dec 13 23:15:13 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 5899C151EF for ; Mon, 13 Dec 1999 23:15:11 -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 IAA23562 for ; Tue, 14 Dec 1999 08:15:09 +0100 (CET) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id IAA61268 for freebsd-arch@freebsd.org; Tue, 14 Dec 1999 08:15:08 +0100 (MET) Received: from mail.xmission.com (mail.xmission.com [198.60.22.22]) by hub.freebsd.org (Postfix) with ESMTP id 5E781157E6 for ; Mon, 13 Dec 1999 23:14:14 -0800 (PST) (envelope-from wes@softweyr.com) Received: from [204.68.178.39] (helo=softweyr.com) by mail.xmission.com with esmtp (Exim 3.03 #3) id 11xmA0-0003ef-00; Tue, 14 Dec 1999 00:14:13 -0700 Message-ID: <3855EE83.5F0823F9@softweyr.com> Date: Tue, 14 Dec 1999 00:15:15 -0700 From: Wes Peters Organization: Softweyr LLC X-Mailer: Mozilla 4.61 [en] (X11; I; FreeBSD 3.3-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Warner Losh Cc: freebsd-arch@freebsd.org Subject: Re: The if_detach problem References: <199912140503.WAA49761@harmony.village.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Warner Losh 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? Been there, done that in the VxWorks stack. You're heading in the right direction. Be sure to grep for dangling ifnet pointers and such while you're at it; you find those in some of the oddest places. It's nice to see that the ip_slowtimo() bug got fixed somewhere along the way. The 4.2 routine did not splnet() so you could crash the system by deleting an interface just as the system was walking the list of interfaces. You'd think the chances of this happening would be miniscule, but we were getting 2 or 3 crashes per year (across our entire customer base) from this stupid problem. -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC wes@softweyr.com http://softweyr.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message