From owner-freebsd-net Fri Sep 15 17: 4:46 2000 Delivered-To: freebsd-net@freebsd.org Received: from dustdevil.waterspout.com (dustdevil.indy.progenylinux.com [64.64.82.245]) by hub.freebsd.org (Postfix) with ESMTP id 24CCA37B422 for ; Fri, 15 Sep 2000 17:04:43 -0700 (PDT) Received: (from csg@localhost) by dustdevil.waterspout.com (8.9.3/8.9.3) id TAA06348; Fri, 15 Sep 2000 19:10:08 -0500 (EST) (envelope-from csg) Date: Fri, 15 Sep 2000 19:10:08 -0500 From: "C. Stephen Gunn" To: Wes Peters Cc: Seigo Tanimura , 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> References: <14772.34738.630468.85559N@rina> <39B59BB9.22C4BDFE@softweyr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <39B59BB9.22C4BDFE@softweyr.com>; from wes@softweyr.com on Tue, Sep 05, 2000 at 07:19:53PM -0600 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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