Subject: possibility of panics in netinet{,6} detach logic
To: None <thorpej@netbsd.org>
From: None <itojun@iijlab.net>
List: tech-net
Date: 07/09/2001 16:06:11
	it seems that PRU_PURGEIF logic still has a possibility for panics.

	the current logic is like below.  therefore, by the time we call the
	2nd in_pcbpurgeif0(), the interface address can be gone already.

	i guess what should be done is like below.  correct me if i'm mistaken.

itojun


--- current code
if_detach()
{
	for (all usrreq)
		xx_usrreq(PRU_PURGEIF);
}

xx_usrreq()
{
	if (cmd == PRU_PURGEIF) {
		in_pcbpurgeif0();
		in_purgeif();
		in_pcbpurgeif();
	}
}

--- should be
if_detach()
{
	for (all usrreq)
		xx_usrreq(PRU_PURGEIF);

	for (all protos)
		xx_purgeif();
}

xx_usrreq()
{
	if (cmd == PRU_PURGEIF) {
		in_pcbpurgeif0();
		in_pcbpurgeif();
	}
}