From nobody Fri Oct 13 18:28:46 2023 X-Original-To: dev-commits-src-main@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 4S6ZlM21hyz4wbgf; Fri, 13 Oct 2023 18:28:47 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S6ZlM1QHDz4Rl3; Fri, 13 Oct 2023 18:28:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697221727; 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=GCyAvIj4c5PJJEFm/ZdFHL+NZdXn4L7NoiZD91C3rgU=; b=of4tlAN9wec6/Sydunw9Y5gZEMqlV0pN2UpD+7XDtgVUlVO7suixK+umD/DAXfe7UMawEJ olb7/yqXN0qFPeZFObI9yFdEft3pBQvwhy24wB42N6qBLV4C8Z9sjQXseJK88ytUKNPLNh WsZM3dK/b4ylAS9SzvUj9OvLrfjykP3qlEQ6e1Aa8ykAevO7PD/Eu9Ey/kAfHau2fH9h5w PwNcuBDSuFtl0Enn1uMc9Rp1vt/6JuYvkVaO3t7BhQEfjTbfh36nNXdgYqkbGD8uZZTzn0 TVmpQiHRfQ0+A/YSj5ceuIwR01rPgdfFVGZVZ1bZjcKCLoS+QoH5I5ONGUyU5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697221727; a=rsa-sha256; cv=none; b=yB5rPA8MUXgrfM+Xtf3VUgs9/7RaXJ2gGqxWdBgVlpLu5luoK7PgTRpzDPPSoxXf9jidwM KGzc2GIzmL9QJ/oJEZXsT1ssVarrzVpLNCuZAxzhmKW+jwi7JyUMaQYpVUbCOzityoHlK1 cvraX3NzFlL9Jwjt9WH0/F8RrTzA9cSNVRMPuOsmn8yhxIzkMe3XBDSqh1IhPcJtefRkTp crhgnQxF6sX7Ap+2+1McLdJsWvwS8ylk9eXs0gGA9AG1qLZZlZoDgC3W2hsSDIsLX4EA+s Od+SCjTJW3CCqVqnhNwN6T+/rvUOkNahWkqhwKpPdbiheybGY1QowgF1SwpkSg== 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=1697221727; 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=GCyAvIj4c5PJJEFm/ZdFHL+NZdXn4L7NoiZD91C3rgU=; b=H9LvM3MKpRCRAQ+t4/x9onQFONbCK1YRqWpl2RYhene+ZnNe0l0d3/kUijq8PTtMbMZxka gKZWhaF7fYWA17KN0dz+bhUv+LKP3ixdMPF+NUi3unjKTGMym+Z7ybSh3YLhRYuZ3r/PAc +RWF3ouKx9XoycmTvgbD5qdUx37b9bXta0sO3AAYDt1oHt0/NVeCTbtvpjrgZGawCm7g49 XTkYR+dPXuFsTWp1BLN0GmaFwM9uA7CkFpRfIE6aT2tsfMsX8CgVM+Mf6lkojDGsArbWxN rhtnAL7tUdFdzbvt07wBMoMvuuZaXaAVJX8kWuTBKMGiLfIU4bU3arKpzt5PaA== 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 4S6ZlM0QCQzy8s; Fri, 13 Oct 2023 18:28:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39DISk3v083068; Fri, 13 Oct 2023 18:28:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39DISksG083065; Fri, 13 Oct 2023 18:28:46 GMT (envelope-from git) Date: Fri, 13 Oct 2023 18:28:46 GMT Message-Id: <202310131828.39DISksG083065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 5e444deec055 - main - Revert "bpf: Add IfAPI analogue for bpf_peers_present()" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5e444deec055c495069988dfcba23a1e08b0f0d0 Auto-Submitted: auto-generated The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=5e444deec055c495069988dfcba23a1e08b0f0d0 commit 5e444deec055c495069988dfcba23a1e08b0f0d0 Author: Justin Hibbits AuthorDate: 2023-10-13 18:29:02 +0000 Commit: Justin Hibbits CommitDate: 2023-10-13 18:33:31 +0000 Revert "bpf: Add IfAPI analogue for bpf_peers_present()" This reverts commit c81dd8e5fe72d0c7ec055c8621bb2da3a3627abf. Commit message needs revised. --- sys/dev/firewire/if_fwip.c | 4 ++-- sys/dev/hyperv/netvsc/if_hn.c | 4 ++-- sys/dev/my/if_my.c | 2 +- sys/dev/usb/usb_pf.c | 4 +++- sys/net/bpf.c | 14 -------------- sys/net/bpf.h | 1 - 6 files changed, 8 insertions(+), 21 deletions(-) diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c index b698db6c9620..5237c555d999 100644 --- a/sys/dev/firewire/if_fwip.c +++ b/sys/dev/firewire/if_fwip.c @@ -780,7 +780,7 @@ fwip_stream_input(struct fw_xferq *xferq) * Record the sender ID for possible BPF usage. */ src = ntohl(p[1]) >> 16; - if (bpf_peers_present_if(ifp)) { + if (bpf_peers_present(if_getbpf(ifp))) { mtag = m_tag_alloc(MTAG_FIREWIRE, MTAG_FIREWIRE_SENDER_EUID, 2*sizeof(uint32_t), M_NOWAIT); @@ -880,7 +880,7 @@ fwip_unicast_input(struct fw_xfer *xfer) goto done; } - if (bpf_peers_present_if(ifp)) { + if (bpf_peers_present(if_getbpf(ifp))) { /* * Record the sender ID for possible BPF usage. */ diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c index f6f885873a79..7d8e1914163e 100644 --- a/sys/dev/hyperv/netvsc/if_hn.c +++ b/sys/dev/hyperv/netvsc/if_hn.c @@ -3262,7 +3262,7 @@ hn_txpkt(if_t ifp, struct hn_tx_ring *txr, struct hn_txdesc *txd) int error, send_failed = 0, has_bpf; again: - has_bpf = bpf_peers_present_if(ifp); + has_bpf = bpf_peers_present(if_getbpf(ifp)); if (has_bpf) { /* * Make sure that this txd and any aggregated txds are not @@ -5972,7 +5972,7 @@ hn_transmit(if_t ifp, struct mbuf *m) omcast = (m->m_flags & M_MCAST) != 0; if (sc->hn_xvf_flags & HN_XVFFLAG_ACCBPF) { - if (bpf_peers_present_if(ifp)) { + if (bpf_peers_present(if_getbpf(ifp))) { m_bpf = m_copypacket(m, M_NOWAIT); if (m_bpf == NULL) { /* diff --git a/sys/dev/my/if_my.c b/sys/dev/my/if_my.c index 631c38df9dca..2bf4573d337b 100644 --- a/sys/dev/my/if_my.c +++ b/sys/dev/my/if_my.c @@ -1152,7 +1152,7 @@ my_rxeof(struct my_softc * sc) * broadcast packet, multicast packet, matches our ethernet * address or the interface is in promiscuous mode. */ - if (bpf_peers_present_if(ifp)) { + if (bpf_peers_present(if_getbpf(ifp))) { bpf_mtap_if(ifp, m); if (if_getflags(ifp) & IFF_PROMISC && (bcmp(eh->ether_dhost, if_getlladdr(sc->my_ifp), diff --git a/sys/dev/usb/usb_pf.c b/sys/dev/usb/usb_pf.c index 4da59419a7c6..43e819684857 100644 --- a/sys/dev/usb/usb_pf.c +++ b/sys/dev/usb/usb_pf.c @@ -408,7 +408,9 @@ usbpf_xfertap(struct usb_xfer *xfer, int type) bus = xfer->xroot->bus; /* sanity checks */ - if (bus->ifp == NULL || !bpf_peers_present_if(bus->ifp)) + if (bus->ifp == NULL || if_getbpf(bus->ifp) == NULL) + return; + if (!bpf_peers_present(if_getbpf(bus->ifp))) return; totlen = usbpf_xfer_precompute_size(xfer, type); diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 96420b709911..8ca6e941e646 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -2879,14 +2879,6 @@ bpfdetach(struct ifnet *ifp) BPF_UNLOCK(); } -bool -bpf_peers_present_if(struct ifnet *ifp) -{ - struct bpf_if *bp = ifp->if_bpf; - - return (bpf_peers_present(bp) > 0); -} - /* * Get a list of available data link type of the interface. */ @@ -3170,12 +3162,6 @@ bpfdetach(struct ifnet *ifp) { } -bool -bpf_peers_present_if(struct ifnet *ifp) -{ - return (false); -} - u_int bpf_filter(const struct bpf_insn *pc, u_char *p, u_int wirelen, u_int buflen) { diff --git a/sys/net/bpf.h b/sys/net/bpf.h index 31968445aac1..924dea5fc9f4 100644 --- a/sys/net/bpf.h +++ b/sys/net/bpf.h @@ -428,7 +428,6 @@ void bpf_mtap2_if(struct ifnet *, void *, u_int, struct mbuf *); void bpfattach(struct ifnet *, u_int, u_int); void bpfattach2(struct ifnet *, u_int, u_int, struct bpf_if **); void bpfdetach(struct ifnet *); -bool bpf_peers_present_if(struct ifnet *); #ifdef VIMAGE int bpf_get_bp_params(struct bpf_if *, u_int *, u_int *); #endif