Date: Tue, 5 Sep 2000 14:38:54 -0400 (EDT) From: Robert Watson <rwatson@FreeBSD.ORG> To: Warner Losh <imp@village.org> Cc: Wes Peters <wes@softweyr.com>, 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: <Pine.NEB.3.96L.1000905143626.2846B-100000@fledge.watson.org> In-Reply-To: <200009050609.AAA58464@harmony.village.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 5 Sep 2000, Warner Losh wrote: > In message <39B48F1E.4C193F79@softweyr.com> Wes Peters writes: > : Ejecting an interface configured up will do that. ifconfig the interface > : `down' and then `delete' before ejecting it. > > At best this is an unsatisfactory workaround. if_detach should cause > the right thing to happen. This is all made harder by the fact that struct mbuf has a struct ifnet pointer in it, so if for any reason there is an outstanding mbuf originating from that interface, it is possible that the struct ifnet * will be dereferenced. For example, if it hits an ipfw rule that dummynets it, then hits an interface-based rule. This has been raised as an issue before, and is a good reason to ifconfig down the interface, and wait a second or two before ejecting. You could imagine code-based solutions, including scanning mbufs (?) for pointers that are undesirable, refcounting the struct ifnet so it isn't freed until all mbufs are free'd, etc. Whatever the case, you want to make sure that locking in the line of fire is avoided (i.e., attempting to lock struct ifnet during packet handling in the interrupt). Robert N M Watson robert@fledge.watson.org http://www.watson.org/~robert/ PGP key fingerprint: AF B5 5F FF A6 4A 79 37 ED 5F 55 E9 58 04 6A B1 TIS Labs at Network Associates, Safeport Network Services To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1000905143626.2846B-100000>