Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Sep 2000 17:24:24 -0600
From:      Wes Peters <wes@softweyr.com>
To:        Warner Losh <imp@village.org>
Cc:        Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp>, current@FreeBSD.ORG, net@FreeBSD.ORG
Subject:   Re: the ifp to a removed pcmcia ethernet card is left in struct  ip_moptions and struct ifmultiaddr
Message-ID:  <39B580A8.CE59B5CF@softweyr.com>
References:  <39B51375.4DE4C6FA@softweyr.com>  <39B48F1E.4C193F79@softweyr.com> <14772.34738.630468.85559N@rina> <200009050609.AAA58464@harmony.village.org> <200009051535.JAA60822@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Warner Losh wrote:
> 
> In message <39B51375.4DE4C6FA@softweyr.com> Wes Peters writes:
> : state the code is in now, and if someone wants it to be better, we await
> : their patches.  As always.  ;^)
> 
> Tanimura-san did contribute patches.  This problem isn't a race at the
> eject, but rather the network layer incompletely cleaning up after a
> device has gone away.

Robert Watson and I had a nice discussion about how to approach that
problem a while back.  I've since gotten busy and forgotten about it,
as has he (apparently).

The quick (-ish) fix I came up with is to double all those cache ifp's
all over the code, and always check the first pointer for a null
reference before diving off through it.  The disadvantage is the check
and dereference on every access, the advantage is being able to
nullify one pointer in the interface take-down and automagically have
all the cached references die.  You would leak a single pointer for
every interface detach, unless you did reference counting or something
like that.

The full solution would be to implement reference counting in the if
objects, and to always check the state of the interface before trying
to exercise an associated function.  It's an ugly problem with no real 
simple solutions (in C).

-- 
            "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-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?39B580A8.CE59B5CF>