From nobody Mon Nov 04 15:19:26 2024 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 4Xhw9p1mpzz5cCbf; Mon, 04 Nov 2024 15:19:26 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xhw9p1JCBz4dYR; Mon, 4 Nov 2024 15:19:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730733566; 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=/1AxSPINhTfRAYONU6+u9OzkgNfJEWqpyary1e6/lPs=; b=vbELzQRagYl7jegwBq/jUU3W9PVZ2IukKt2t8MSLAYR5DvCOS0Lx/u9lyVD1KtzTx1Hbxg BBf9oKCf+lHUOX2E+AUPT2qBayR+183KiJmai3PMX8kSB/MOa58aCpqzHTjyhWOnq9t4Az 6kkgQwXQyqmhRwmnVIhTw7aUh4TDCQTi8nZmRraJ+xLmrjEXmqwqGRO1dLv0WhK6Z66kAg F/MnessEod9eNPC5/zpHJl9YdYBHL+efx6wm32UKBs6cd6mvmngWUp5kpVmaz3q7L7pgmb cVLIoDktkR9yBF1kTuvGzPjEN2oSO51gttkBofdY6mV0lhBHj/xvxvrwoUsjUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730733566; 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=/1AxSPINhTfRAYONU6+u9OzkgNfJEWqpyary1e6/lPs=; b=uB+a3VtyfGbFuuK9AMwR9UPnqykKLMEmDCv+SirKQx+Vll8oWPhhz9PYfhw8L+ifD4CdzE erjFKnODVbEoAaT9Tf/fxU9c7TidPbNCV282fenQm2ZlHrBB1GF1gwHDowx2ok6bVko17O 80nRRzFOTlXwQeMfKvxl2QNyWhY2RsW6B5Dj08WtcQdPKtKWC9KX+91329C6BXEaVMFxwu g5XlY53T2dBkyGoWDxkBJXyB8KpksNVP8RZRgdSUeMJWVMcXwb5oObKFJtcC+tV3Q2ZVwt gqx8/sasL5PO+xR8TZ4+IMadynER0x/9OHsQJuAWCImYAXB6ZOf6tuGO+k8GcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730733566; a=rsa-sha256; cv=none; b=Qy8JPxHcReerJo268spP2Acazq56T7PVQxFc1M48FhSksIXR+0o5npkhJq3fFoD6rNOkRB rgh0jjAsiMWjaHXD3p/2RYdFz4RlqT6pL+piWd0dke+9veCBADIS2IbLEL2xnOOFyspE2n gWjZ1/OTMwd3eCBCDXTp1Fr6CLnvnj33aHKkGIHgj5a/ADGx8iSlGw3icweq11kyrXdj+s YMbqlWyjQqlyWQ+rUAvlF8uSISznpN3+2FxHeBTxf4Sy1GbPqjufZRs10l+PG0eRcrCpwl IZ4qPE92YllTw55n2AkVHIqVg76AepRUbsCfOmQzYdSCcP4GiWDNdBEUuYEyFg== 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 4Xhw9p0vRnzdxN; Mon, 4 Nov 2024 15:19:26 +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 4A4FJQM7098587; Mon, 4 Nov 2024 15:19:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A4FJQKW098584; Mon, 4 Nov 2024 15:19:26 GMT (envelope-from git) Date: Mon, 4 Nov 2024 15:19:26 GMT Message-Id: <202411041519.4A4FJQKW098584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 9ca328626400 - main - pf: fix build on kernels without "options INET" 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9ca3286264006d196eeb4a284ca837ca84207a3d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9ca3286264006d196eeb4a284ca837ca84207a3d commit 9ca3286264006d196eeb4a284ca837ca84207a3d Author: Lexi Winter AuthorDate: 2024-11-03 16:05:05 +0000 Commit: Kristof Provost CommitDate: 2024-11-04 14:17:19 +0000 pf: fix build on kernels without "options INET" - IN_LOOPBACK() cannot be used without INET, because it references a VNET symbol vnet_entry_in_loopback_mask. - ip_fillid() is not available without INET. since this codepath is only entered in the AF_INET case, guard it with #ifnet INET. Fixes: 27f54be50bbad ("pf: merge pf_test() and pf_test6()") Fixes: 4f9e688708f1b ("pf: merge pf_scrub_ip() and pf_scrub_ip6()") Reviewed by: kp --- sys/netpfil/pf/pf.c | 2 ++ sys/netpfil/pf/pf_norm.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 17614e1a9995..90ec2b1ed033 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -576,8 +576,10 @@ static bool pf_is_loopback(sa_family_t af, struct pf_addr *addr) { switch (af) { +#ifdef INET case AF_INET: return IN_LOOPBACK(ntohl(addr->v4.s_addr)); +#endif case AF_INET6: return IN6_IS_ADDR_LOOPBACK(&addr->v6); default: diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 860580812e3b..8779d599900e 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -2224,6 +2224,7 @@ pf_scrub(struct pf_pdesc *pd) } /* random-id, but not for fragments */ +#ifdef INET if (pd->af == AF_INET && pd->act.flags & PFSTATE_RANDOMID && !(h->ip_off & ~htons(IP_DF))) { uint16_t ip_id = h->ip_id; @@ -2231,5 +2232,6 @@ pf_scrub(struct pf_pdesc *pd) ip_fillid(h); h->ip_sum = pf_cksum_fixup(h->ip_sum, ip_id, h->ip_id, 0); } +#endif } #endif