From nobody Mon Jul 08 11:32:52 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 4WHhnK0zQ4z5Pyjr; Mon, 08 Jul 2024 11:32:53 +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 4WHhnK0S7Tz4WsK; Mon, 8 Jul 2024 11:32:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720438373; 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=D0qhoSQDfI/lv1KrkjMz5ApT4hh283oLXPTebLSX3eg=; b=g0Jt3Xk+JkBRpVgT3/pk3/4Z6DS7MSSK/J8guel26tzuX5e0F/IyRS/fGVa8K9Uro+YuJo A/yY3JvBUseSglMPz+QhcAwtb8STZHjiif7qq3WiFufaGqOa1AzQ0zNgT4VYImPA15nhpT 04H4UJs5BW+NvE/xT0lz6V+vK1WLdvO3W5absCWyxm3E6wJKIpJoQ7qWi6bpq55/0coN+o AezsMnjcQW5FmmQ9bse+IcPHGt0EZVUgdOls5a7MK5xDYfj1RMgIRXuV8W/syeEc3HG0s5 3bXBQvi52hbGik8FQmsVhJ4emV+dojatNP5EJ7AG2AmJj2xtKvzGkXxdNBht0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720438373; a=rsa-sha256; cv=none; b=U/y4h/o5Wjgx09cvkExANdqukUcE3uIqHjtFLuGuLz4CzilIMkIFpJxEhlhA6xdlFKGxSe 09Ct9fP1OD2ZWye1O3nNGClZlIU9arYA4gJU8J1DG/TyjaBWFyCk9yBvw7BnEUqCKdHzsV wByi3rzcWr8cWK1Z+lwYB++9AmAwaBOR4sOnMc/U8VBixCUqFyOrRMh6i4AF6rCc96B6Wl qBl85iRBVjwe7RxmJ6Ix2KzcWuSF0/f4SvmLwe7lbCVwD6vXOMBfbKVa/GnD3oXx0FKop9 Z6GAyXniYcQNwMrBUV7SEnuUCeHioXIdLi2mFIHjRiaw8G7jh9Yt6hwCAl25jQ== 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=1720438373; 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=D0qhoSQDfI/lv1KrkjMz5ApT4hh283oLXPTebLSX3eg=; b=I3HLZ5KIoO8K9dihYXFTrrR1DzCVC7PEkLaVHZRfh+dyl8lH/5lLYYwPamS7KkWxm0lKHE s9f8Gs835DVeto3O+qvCSJ4Oa7O97U255WiCKE8eDCIhC6JzvcYjQcLQmdQP9iKxepRPf4 zmYwyaixVWKOLf7ZSxagjBpGUbsZJFcCc+WalRt1r8BNQgIrT+O2+4awkV3aEv8VYbN86M p5e0NrrXUiW1qP2qITVaDcMxcQN5VOiTmvH4VNVLe/InCUP2GX8c+nV0MPxSnHzBeihiSv yktyHuj7/rNLXXRQ/H9JJzju5R2fnKI5qV0XSWUMlx+0PVb6HEMNug7uvxF0Jg== 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 4WHhnK03Z1zq4t; Mon, 8 Jul 2024 11:32:53 +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 468BWqXS006544; Mon, 8 Jul 2024 11:32:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 468BWq2F006541; Mon, 8 Jul 2024 11:32:52 GMT (envelope-from git) Date: Mon, 8 Jul 2024 11:32:52 GMT Message-Id: <202407081132.468BWq2F006541@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: a8790965b0c6 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: a8790965b0c6b63ec64c42f236cd09cef06f481c Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a8790965b0c6b63ec64c42f236cd09cef06f481c commit a8790965b0c6b63ec64c42f236cd09cef06f481c Author: Zhenlei Huang AuthorDate: 2024-06-30 09:44:21 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-08 11:30:57 +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) --- sys/net/if.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index b38784622e92..110ab73f2aad 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1267,20 +1267,8 @@ finish_vnet_shutdown: static int if_vmove(struct ifnet *ifp, struct vnet *new_vnet) { -#ifdef DEV_BPF - u_int bif_dlt, bif_hdrlen; -#endif 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. @@ -1302,12 +1290,6 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet) */ CURVNET_SET_QUIET(new_vnet); if_attach_internal(ifp, true); - -#ifdef DEV_BPF - if (ifp->if_bpf == NULL) - bpfattach(ifp, bif_dlt, bif_hdrlen); -#endif - CURVNET_RESTORE(); return (0); }