aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2026-02-12 20:11:09 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2026-02-13 19:39:37 +0000
commit596bf3485fe5dd62991e0f49ee783bc91d83678c (patch)
tree24c79d33379bb76fb5b426820d22940d2138eda5
parentd19fd2f349226116f7effb281baa1eb32b8292e7 (diff)
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
-rw-r--r--sys/net/bpf.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 228ac9867bd7..05877f6410a4 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -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);