* Close the descriptor by detaching it from its interface, * deallocating its buffers, and marking it free. */
| 900 | * deallocating its buffers, and marking it free. |
| 901 | */ |
| 902 | static void |
| 903 | bpf_dtor(void *data) |
| 904 | { |
| 905 | struct bpf_d *d = data; |
| 906 | |
| 907 | BPFD_LOCK(d); |
| 908 | if (d->bd_state == BPF_WAITING) |
| 909 | callout_stop(&d->bd_callout); |
| 910 | d->bd_state = BPF_IDLE; |
| 911 | BPFD_UNLOCK(d); |
| 912 | funsetown(&d->bd_sigio); |
| 913 | bpf_detachd(d); |
| 914 | #ifdef MAC |
| 915 | mac_bpfdesc_destroy(d); |
| 916 | #endif /* MAC */ |
| 917 | seldrain(&d->bd_sel); |
| 918 | knlist_destroy(&d->bd_sel.si_note); |
| 919 | callout_drain(&d->bd_callout); |
| 920 | bpfd_rele(d); |
| 921 | } |
| 922 | |
| 923 | /* |
| 924 | * Open ethernet device. Returns ENXIO for illegal minor device number, |
nothing calls this directly
no test coverage detected