From nobody Wed Apr 13 23:09:33 2022 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 7D9DE1B40BD1; Wed, 13 Apr 2022 23:09:34 +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 4KdywG0fNVz4m2S; Wed, 13 Apr 2022 23:09:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649891374; 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=SKd0/HlAqSV1GkrLp4sg/fJNSHl1QTyxJHjD2DRQLlk=; b=nvBbSbqjcFbXtrbH9nrrGlUHhSKYRuay4NbMVQ5OquI24xIQR78eQm/6azDEPS/0r2zXem FfE8a73uxhttuVot/bI6lBaPFL/rFiHVDkfnFnHwYtRWb96FlXuFBy0dAfXX6hVe1rAtiA nt+M0rr8DFFcDtE6jL1FyUxgMk6lmjOKZjOSTFT8ORXKPignYiKvTCjQJodqoitZI671ba sGiBg92EKtvb1d1A8lFonP34Zasfku1YHsoaUWbQaEb1hpj0JUOfYQocDDcN/dtCBtSJf8 3TmXlQA0+TNqr7dvcgSEA3dceVexZAN79p6HCmXyHBUoidUe6m8od6EmHhbxdw== 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 A40AD1502E; Wed, 13 Apr 2022 23:09:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23DN9XAY074537; Wed, 13 Apr 2022 23:09:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23DN9XUY074536; Wed, 13 Apr 2022 23:09:33 GMT (envelope-from git) Date: Wed, 13 Apr 2022 23:09:33 GMT Message-Id: <202204132309.23DN9XUY074536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 2fdf3ed1e330 - main - ng_netflow: Move various variables under INET || INET6. 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2fdf3ed1e330c72eaf8beb745d4717e6c262b5f6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649891374; 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=SKd0/HlAqSV1GkrLp4sg/fJNSHl1QTyxJHjD2DRQLlk=; b=uVIMWW1JhxVwQ1AXFZpFavuLPB5J/J4c0y3YfV4jQPUeK1OwOc4GAo58/gnHMWlbGbDgzW G3KdHoqGTYX8Uv0qMrHB5jegW1NJlHCsjidyRVUdMS4k5a6Wp3r0nYZ09TP8sJUofLmxOv kVY0nOYwc0krR4lVc+pVuTFe+IN3W1ibUfUDtpKZZaIbv9hDji2T/alCYSPZQug0QgR7nA 02DKnvGAdtG8ZaIoYq9V0W5NqX6LmXy+KxMdSz5Yl+/2GLJQ0IFrw0ySiOpL679CuCLZfa 8gIM91KQGu2c0obOkrM/7AVSv7XqfUMpif5+uTryw3M+k2uFM5QfpJkdhHlvAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649891374; a=rsa-sha256; cv=none; b=pUfoGVwTZQG8hj7IKK+l7a3G5NQKF+uvyEzmpAhcSsr7Lf3EZl3TgZmAHvIX2J4BprJerb utcEy1arW/3aL7QtJkXY7Y9aP1zI1lDalBUkdfZhyGKPZ7a5aqDBcnclTmgytNkDlwjlPN Hva8qSBPLLTZ4c42PRT3b8Vy+xbco/9/YsNTuvpJ4Rbeky0687Vz4cSmXl5EEIpJLOfFGq tMmRsaMqs+LP8q32sw6nq8U3gWZ16yOaiK7utIoeG2wSB5SEjY0CpTSA7HJwN+vk764UM2 Bs19lZw2nIKmdGaK8IqPSqduPxq9yWliV18PrU6fcStYn6iNmCVKT8+gLoZUeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2fdf3ed1e330c72eaf8beb745d4717e6c262b5f6 commit 2fdf3ed1e330c72eaf8beb745d4717e6c262b5f6 Author: John Baldwin AuthorDate: 2022-04-13 23:08:21 +0000 Commit: John Baldwin CommitDate: 2022-04-13 23:08:21 +0000 ng_netflow: Move various variables under INET || INET6. --- sys/netgraph/netflow/ng_netflow.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/sys/netgraph/netflow/ng_netflow.c b/sys/netgraph/netflow/ng_netflow.c index 187e18a3130e..ab0aff5cf7fc 100644 --- a/sys/netgraph/netflow/ng_netflow.c +++ b/sys/netgraph/netflow/ng_netflow.c @@ -594,11 +594,15 @@ ng_netflow_rcvdata (hook_p hook, item_p item) struct ip *ip = NULL; struct ip6_hdr *ip6 = NULL; struct m_tag *mtag; - int pullup_len = 0, off; - uint8_t acct = 0, bypass = 0, flags = 0, upper_proto = 0; + int pullup_len = 0; + uint8_t acct = 0, bypass = 0; int error = 0, l3_off = 0; +#if defined(INET) || defined(INET6) + int off; + uint8_t flags = 0, upper_proto = 0; unsigned int src_if_index; caddr_t upper_ptr = NULL; +#endif fib_export_p fe; uint32_t fib; @@ -655,8 +659,10 @@ ng_netflow_rcvdata (hook_p hook, item_p item) } } +#if defined(INET) || defined(INET6) /* Import configuration flags related to flow creation */ flags = iface->info.conf & NG_NETFLOW_FLOW_FLAGS; +#endif NGI_GET_M(item, m); m_old = m; @@ -775,7 +781,9 @@ ng_netflow_rcvdata (hook_p hook, item_p item) break; } +#if defined(INET) || defined(INET6) off = pullup_len; +#endif if ((ip != NULL) && ((ip->ip_off & htons(IP_OFFMASK)) == 0)) { if ((ip->ip_v != IPVERSION) || @@ -787,9 +795,11 @@ ng_netflow_rcvdata (hook_p hook, item_p item) */ M_CHECK((ip->ip_hl << 2) - sizeof(struct ip)); +#if defined(INET) || defined(INET6) /* Save upper layer offset and proto */ off = pullup_len; upper_proto = ip->ip_p; +#endif /* * XXX: in case of wrong upper layer header we will @@ -811,8 +821,10 @@ ng_netflow_rcvdata (hook_p hook, item_p item) * Nothing to save except upper layer proto, * since this is a packet fragment. */ +#if defined(INET) || defined(INET6) flags |= NG_NETFLOW_IS_FRAG; upper_proto = ip->ip_p; +#endif if ((ip->ip_v != IPVERSION) || ((ip->ip_hl << 2) < sizeof(struct ip))) goto bypass; @@ -914,6 +926,7 @@ loopend: ip6 = (struct ip6_hdr *)(mtod(m, caddr_t) + l3_off); } +#if defined(INET) || defined(INET6) upper_ptr = (caddr_t)(mtod(m, caddr_t) + off); /* Determine packet input interface. Prefer configured. */ @@ -923,6 +936,7 @@ loopend: src_if_index = m->m_pkthdr.rcvif->if_index; } else src_if_index = iface->info.ifinfo_index; +#endif /* Check packet FIB */ fib = M_GETFIB(m);