MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bpf_dtor

Function bpf_dtor

freebsd/net/bpf.c:902–921  ·  view source on GitHub ↗

* Close the descriptor by detaching it from its interface, * deallocating its buffers, and marking it free. */

Source from the content-addressed store, hash-verified

900 * deallocating its buffers, and marking it free.
901 */
902static void
903bpf_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,

Callers

nothing calls this directly

Calls 6

funsetownFunction · 0.85
bpf_detachdFunction · 0.85
mac_bpfdesc_destroyFunction · 0.85
seldrainFunction · 0.85
knlist_destroyFunction · 0.85
bpfd_releFunction · 0.85

Tested by

no test coverage detected