FreeBSD/sys/net/bpf.c
/*
 * Close the descriptor by detaching it from its interface,
 * deallocating its buffers, and marking it free.
 */
Close the descriptor by detaching it from its interface,
deallocating its buffers, and marking it free.
Close the descriptor by detaching it from its interface deallocating its buffers and marking it free .
static void
bpf_dtor(void *data)
{
	struct bpf_d *d = data;
	BPFD_LOCK(d);
	if (d->bd_state == BPF_WAITING)
		callout_stop(&d->bd_callout);
	d->bd_state = BPF_IDLE;
	BPFD_UNLOCK(d);
	funsetown(&d->bd_sigio);
	bpf_detachd(d);
#ifdef MAC
	mac_bpfdesc_destroy(d);
#endif 
	seldrain(&d->bd_sel);
	knlist_destroy(&d->bd_sel.si_note);
	callout_drain(&d->bd_callout);
	bpf_freed(d);
	free(d, M_BPF);
}
static void bpf_dtor ( void * data ) { struct bpf_d * d = data ; BPFD_LOCK ( d ) ; if ( d -> bd_state == BPF_WAITING ) callout_stop ( & d -> bd_callout ) ; d -> bd_state = BPF_IDLE ; BPFD_UNLOCK ( d ) ; funsetown ( & d -> bd_sigio ) ; bpf_detachd ( d ) ; #ifdef MAC mac_bpfdesc_destroy ( d ) ; #endif seldrain ( & d -> bd_sel ) ; knlist_destroy ( & d -> bd_sel . si_note ) ; callout_drain ( & d -> bd_callout ) ; bpf_freed ( d ) ; free ( d , M_BPF ) ; }
Close the descriptor by detaching it from its interface,
 deallocating its buffers, and marking it free.
Close the descriptor by detaching it from its interface deallocating its buffers and marking it free .
/* MAC */