Which mutex to lock when accessing a "struct ifnet*" ?
From: John Giacomoni (John.Giacomoni_at_colorado.edu)
Date: 10/29/03
- Previous message: Vinod R. Kashyap: "freeing data segment"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 29 Oct 2003 13:53:56 -0700 To: freebsd-hackers@freebsd.org
I'm writing some code which examines the the state of a "struct ifnet*"
as returned by "ifunit".
In what situations is it possible for the "struct <foo>_softc"
to be deleted taking it's "struct ifnet" with it?
Does it never go away?
I assume it is possible for the structure to go away given
support for pcmcia cards.
Is Giant the correct lock as suggested by the /usr/src/sys/net/bpf.c
(when it calls ifpromisc) to protect against this occurrence?
doesn't seem right as my understanding is Giant is being eliminated.
The other assumption would be struct ifnet's own mutex but there
would be a race to locking it after one gets a reference to it
(via ifunit).
Ideas?
thanks
John G
-- University of Colorado at Boulder John.Giacomoni@colorado.edu Department of Computer Science phone: 303.492.8115 Engineering Center, ECCS 121 303.492.7906 430 UCB fax: 303.492.2844 Boulder, CO 80303-0430 USA _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
- Previous message: Vinod R. Kashyap: "freeing data segment"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]