git: 1c82bbd8650a - main - pf: Fix NOINET and NOINET6 build.

From: Dag-Erling Smørgrav <des_at_FreeBSD.org>
Date: Wed, 02 Oct 2024 17:56:50 UTC
The branch main has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=1c82bbd8650ab2c7247342dac7460d18fea90ed0

commit 1c82bbd8650ab2c7247342dac7460d18fea90ed0
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2024-10-02 17:50:01 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2024-10-02 17:54:10 +0000

    pf: Fix NOINET and NOINET6 build.
    
    The issue was only apparent when ALTQ was not enabled, which is why it
    was not revealed by `make universe`.
    
    Fixes:          27f54be50bb
    Reviewed by:    kp, imp
    Differential Revision:  https://reviews.freebsd.org/D46877
---
 sys/netpfil/pf/pf.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index b5a18c37a89b..bbed285ab9f8 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -8854,8 +8854,12 @@ pf_test(sa_family_t af, int dir, int pflags, struct ifnet *ifp, struct mbuf **m0
 	struct pfi_kkif		*kif;
 	u_short			 action, reason = 0;
 	struct mbuf		*m = *m0;
+#ifdef INET
 	struct ip		*h = NULL;
+#endif
+#ifdef INET6
 	struct ip6_hdr		*h6 = NULL;
+#endif
 	struct m_tag		*mtag;
 	struct pf_krule		*a = NULL, *r = &V_pf_default_rule;
 	struct pf_kstate	*s = NULL;
@@ -9210,10 +9214,14 @@ done:
 			else
 				pd.pf_mtag->qid = pd.act.qid;
 			/* Add hints for ecn. */
+#ifdef INET
 			if (af == AF_INET)
 				pd.pf_mtag->hdr = h;
-			else
+#endif
+#ifdef INET6
+			if (af == AF_INET6)
 				pd.pf_mtag->hdr = h6;
+#endif
 		}
 	}
 #endif /* ALTQ */