From nobody Mon Jul 08 11:41:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WHhzm2d7Nz5Q0yf; Mon, 08 Jul 2024 11:41:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WHhzm26W6z4XL2; Mon, 8 Jul 2024 11:41:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720438916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zuLj6E/dDnA/fSCHvdnPt/k0kQvMzs4ijCvErbON53E=; b=fxRj8tANYY5zCufzcfgzVQokp0ljlW9eOd2GGChCfhv+WwZ+21U5sYfqIts+H++3cvEhQG m1iytpA1CLmc58UuPG9CQAsOA8Pbf7/7LxhA5/hXtw/59+G914bMadMQOGp6yQ2bMAl4TB U9lKSgFXI8GIoi/AkLqW3uWAcT2cIn5+Lw6HujexEDh1VbRjrdDZWuUr5lR0jUjguJMOsv swOasXEz3SRMl2zTF0AsoIp8aUFuoUda1rmJkzq+HjjM6qGnQ7YSHNex7N8gJZeM/PVBCU 9tZFc+76iNv8O5YJ4sutEnN17QdWPM2mZIMAfDrob5cZhuznid0Y9iOK1RIjuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720438916; a=rsa-sha256; cv=none; b=tWC+VGdLqSacgXzmHMWVHQoqcCTcVo0sYFReanne3cJnAFOZ6zabVJ5MtYz89DxGwezNaX oqhaaHqp2/hh6LZIHAwQzgvCG++LW7tjNxxCkEn3QAN8PRjcgRrbRXknbxkuz/SKN6bSkP nOdRCDNbfofgEp6sqIPECejN1GbiNc+dDna1xStRTrWujKSfDsJFdIimZdJY4N4PoBYZfJ U/oZqJdwaTVElVPiPpDKD+v+KEiolQe8uenuAaAw8a9iRsDd3YyNnh7l7fkb6WShelxzZt YjNjuu6R/bJnWXVJJJ7EI6jyF7FI7WrH84IJcnmS48XkCPfRmZ8l5EQMXWLluQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720438916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zuLj6E/dDnA/fSCHvdnPt/k0kQvMzs4ijCvErbON53E=; b=wVgRHW8+hRTs91HMxR42gyjP0NkdWqz+lHhcygXci+F4gHtRPNvMTE89R6LwbN7WVuVh5n Trxk5gZe/gdhl0TGBQEvqpYXaQRLoLT1AePivyJJ7DbRqKEBVl6dG23z9DOk7ZFXGJjU2/ CVNnwU3Hj/ODesAhUt1NXO5UoY1zbyJskZjO+Uqc0xMmITiE+ijNzQVOgKWbDepSNKQ+X8 4j5GUM9oE6tg+lpigq3zBGGjaeoYTn7qQ7DpKa8C5cpPt+/gX8G/DL8x+zZw7GIWJh62ut zwMuroMjrESWJ+Heppr726S3S856bGALDFid2C6yMVS36pvM4nYaTleW3UgWcg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WHhzm1k0NzqPv; Mon, 8 Jul 2024 11:41:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 468Bfuub017462; Mon, 8 Jul 2024 11:41:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 468Bfumm017459; Mon, 8 Jul 2024 11:41:56 GMT (envelope-from git) Date: Mon, 8 Jul 2024 11:41:56 GMT Message-Id: <202407081141.468Bfumm017459@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 82c1ab4413e0 - stable/13 - ifnet: Remove dead code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 82c1ab4413e090f35870d471c97109299ad62fa8 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=82c1ab4413e090f35870d471c97109299ad62fa8 commit 82c1ab4413e090f35870d471c97109299ad62fa8 Author: Zhenlei Huang AuthorDate: 2024-06-30 09:44:21 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-08 11:36:30 +0000 ifnet: Remove dead code Since change [1], if_bpf will not be detached by the interface departure eventhandler and will not be NULL. Then the logic to re-attach if_bpf becomes dead and serves no purpose any more. This partially reverts commit 05fc416403ec. 1. 9ce40d321dd5 bpf: Fix incorrect cleanup Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45599 (cherry picked from commit 9738277b5c662a75347efa6a58daea485d30f895) (cherry picked from commit a8790965b0c6b63ec64c42f236cd09cef06f481c) --- sys/net/if.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index e457ce5c4705..a7aed084143c 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1314,21 +1314,9 @@ static int if_vmove(struct ifnet *ifp, struct vnet *new_vnet) { struct if_clone *ifc; -#ifdef DEV_BPF - u_int bif_dlt, bif_hdrlen; -#endif void *old; int rc; -#ifdef DEV_BPF - /* - * if_detach_internal() will call the eventhandler to notify - * interface departure. That will detach if_bpf. We need to - * safe the dlt and hdrlen so we can re-attach it later. - */ - bpf_get_bp_params(ifp->if_bpf, &bif_dlt, &bif_hdrlen); -#endif - /* * Detach from current vnet, but preserve LLADDR info, do not * mark as dead etc. so that the ifnet can be reattached later. @@ -1374,11 +1362,6 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet) if_attach_internal(ifp, 1, ifc); -#ifdef DEV_BPF - if (ifp->if_bpf == NULL) - bpfattach(ifp, bif_dlt, bif_hdrlen); -#endif - CURVNET_RESTORE(); return (0); }