Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Dec 1999 00:15:15 -0700
From:      Wes Peters <wes@softweyr.com>
To:        Warner Losh <imp@village.org>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: The if_detach problem
Message-ID:  <3855EE83.5F0823F9@softweyr.com>
References:  <199912140503.WAA49761@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3855EE83.5F0823F9>