Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Feb 2026 19:39:56 +0000
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 596bf3485fe5 - main - bpf: don't call bpf_detachd() in bpf_setdlt()
Message-ID:  <698f7e0c.41b00.34065fc8@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=596bf3485fe5dd62991e0f49ee783bc91d83678c

commit 596bf3485fe5dd62991e0f49ee783bc91d83678c
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2026-02-12 20:11:09 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2026-02-13 19:39:37 +0000

    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
---
 sys/net/bpf.c | 1 -
 1 file changed, 1 deletion(-)

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);


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?698f7e0c.41b00.34065fc8>