Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Sep 2000 19:10:08 -0500
From:      "C. Stephen Gunn" <csg@waterspout.com>
To:        Wes Peters <wes@softweyr.com>
Cc:        Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp>, freebsd-net@FreeBSD.ORG
Subject:   Re: the ifp to a removed pcmcia ethernet card is left in struct ip_moptions and struct ifmultiaddr
Message-ID:  <20000915191008.A6079@waterspout.com>
In-Reply-To: <39B59BB9.22C4BDFE@softweyr.com>; from wes@softweyr.com on Tue, Sep 05, 2000 at 07:19:53PM -0600
References:  <14772.34738.630468.85559N@rina> <39B59BB9.22C4BDFE@softweyr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 05, 2000 at 07:19:53PM -0600, Wes Peters wrote:

> The full solution would be to implement ifs a full 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).

I was thinking about this issue (since it hits my VAIO once in a
while).  You could minimize the effect by defining reasonable "the
device is gone" routines for the ifnet callbacks.  Future attempts
to use the ifnet would simply return the appropriate error.

You also might want to add an IFF_DETACHED flag (I know the flags
word is currently full), and stick this defunct ifnet on a list
(to recycle at a later date).  Perhaps sticking it on the recycle
list, and replacing the function table is sufficient indication
that this interface is not around.

If you get the ethernet (and other ifnet consumers) drivers to use
an allocator function for ifnet(s), then that allocator could
recycle the old struct, or malloc() a new one as appropriate.

   struct ifnet *ifnet_alloc(char *ifname);

NOTE: A cursory glance at the implementation, leads me to believe
      that newbus is allocating most of the device->softc(s), and
      therefore the struct ifnet/arpcom to boot.

There's still the potential for problems, especially with lingering
connnections that aren't necessairly intended for the new network
connection.  However, I estimate that the likelyhood of connecting
to the same network is pretty high.

 - Steve


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?20000915191008.A6079>