From nobody Sun Jun 30 09:46:01 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 4WBknj6P79z5PJ82; Sun, 30 Jun 2024 09:46:01 +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 4WBknj59hjz4X8k; Sun, 30 Jun 2024 09:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719740761; 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=Xuo56QFMXIP1mTu50DlGZ213s4gn7K1fyZZ2VV9o/hQ=; b=c1UJFIVj3zB6Xk5wM6OwzID9YBxwZYxTY1T48GbAclBzn34gJanMLoCVRJCSU0ELImKSl8 EvXvK44b3MUx/SrJnbikAO+d5XXtnYLHACqXnEHSFxXKB/sQ8Fga9IJeMm3n9/W0ZRVUqt CzG3zu1RcJ21GKktEo/5uaUVXlOlMz9uIZ5YRIM9kH9ZmwGLBJVloFjCY+i90ZFUDNRIwm EsmlcIC1A6T2SvJVMpnJar+omS5BOeCw2IsbnzGScFIxgmt2L2PHfB+pcvaCDT1Rds87ma T7rjgSlBfmIfTfolmXRg+wSGLjSEiENXSlcQhp0G15ydBCBwRxtHLjSWIPZuRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719740761; a=rsa-sha256; cv=none; b=p6y/aZ9OXx0j2AWokjx8lDxnvMltCz4xq6PzXxa5uRBIgdRKYM5lCOyOm0FgOUWP4CKccN A+mqnShYtpc513pFPrOcqU/Jis7abNDJT+DSKU78UL0MvTpHLm7MY/AD11tEBoy5doWYzj sOHs8F2nhqKC/Q9LSdLWpaJMIU/1DFzKiqsZTAxQjV6RbQtZqXiV6CuiQfHPUIU3HPkh24 KbdAuoxiw6Dcv4mqCUrSZDQVbKytRQqifcvSyrSbbKInrvNi+9P+H+RezVtIh4chOuZe/t uQn2rk5QD2RANheWkS+dtUffYRenRn/QmUauvWT9ZHDiV4YEG2Wco4LuptoxHg== 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=1719740761; 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=Xuo56QFMXIP1mTu50DlGZ213s4gn7K1fyZZ2VV9o/hQ=; b=vfndi+6utqhQOqx1HIPsLalAXOAB9+lyKpM9FPbs7pWPxwQqqPx1IVTCpwLClJthNL8SyS XoWEKiJMPpT3kdrWEFMGjHELzvioKvMPkCV3LNu7w14RUoAwmGA47o1jHorCs+46pJfqTL 1jqJW4JSwh6RCIdKl+Q5/AzlP03coGYFwZTuzwQy4BO0PqP9ZzBKNfS3LQgGCXv0jPK9Pm aeL5ffIp7jtC29NR33KcbRrw89lwCPKoRbdwkbNcvx/BWQ7n8HbAQlXS0u5+YYvULkeiKj RoFjxibNIYrPQo3VFR1APTUZgrTJODkem76yysrDbwfqJ/cP8xIAEc921coT4w== 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 4WBknj4fxdzGFp; Sun, 30 Jun 2024 09:46:01 +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 45U9k1YE083894; Sun, 30 Jun 2024 09:46:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 45U9k1GZ083891; Sun, 30 Jun 2024 09:46:01 GMT (envelope-from git) Date: Sun, 30 Jun 2024 09:46:01 GMT Message-Id: <202406300946.45U9k1GZ083891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 9738277b5c66 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 9738277b5c662a75347efa6a58daea485d30f895 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=9738277b5c662a75347efa6a58daea485d30f895 commit 9738277b5c662a75347efa6a58daea485d30f895 Author: Zhenlei Huang AuthorDate: 2024-06-30 09:44:21 +0000 Commit: Zhenlei Huang CommitDate: 2024-06-30 09:44:21 +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 --- sys/net/if.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 98be23e564c6..ee8fe533f338 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1265,20 +1265,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. @@ -1300,12 +1288,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); }