bpf: don't call bpf_detachd() in bpf_setdlt()

The bpf_attachd() will perform bpf_detachd() itself.  Performing it twice
will lead to doing CK_LIST_REMOVE twice.

Reported & tested by:	bz
This commit is contained in:
Gleb Smirnoff
2026-02-12 12:11:09 -08:00
parent d19fd2f349
commit 596bf3485f
-1
View File
@@ -2821,7 +2821,6 @@ bpf_setdlt(struct bpf_d *d, u_int dlt)
return (EINVAL);
opromisc = d->bd_promisc;
bpf_detachd(d, false);
bpf_attachd(d, bp);
if (opromisc) {
error = bp->bif_methods->bif_promisc(bp->bif_softc, true);