On Tue, 5 Sep 2000, Warner Losh wrote:

> In message <[EMAIL PROTECTED]> 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 

[EMAIL PROTECTED]              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 [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to