git: a693d17b9985 - main - pf: fix !INET or !INET6 builds

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Wed, 16 Mar 2022 19:52:42 UTC
The branch main has been updated by glebius:

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

commit a693d17b9985a03bd9b5108e890d669005ab41eb
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2022-03-16 19:52:07 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2022-03-16 19:52:07 +0000

    pf: fix !INET or !INET6 builds
    
    Fixes:  pfr_match_addr8a42005d1e4
---
 sys/netpfil/pf/pf.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index a900da0b8bd1..0a479c8a77e8 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -3855,6 +3855,7 @@ pf_test_eth_rule(int dir, struct pfi_kkif *kif, struct mbuf **m0)
 	proto = ntohs(e->ether_type);
 
 	switch (proto) {
+#ifdef INET
 	case ETHERTYPE_IP: {
 		struct ip *ip;
 		m = m_pullup(m, sizeof(struct ether_header) +
@@ -3869,6 +3870,8 @@ pf_test_eth_rule(int dir, struct pfi_kkif *kif, struct mbuf **m0)
 		dst = (struct pf_addr *)&ip->ip_dst;
 		break;
 	}
+#endif /* INET */
+#ifdef INET6
 	case ETHERTYPE_IPV6: {
 		struct ip6_hdr *ip6;
 		m = m_pullup(m, sizeof(struct ether_header) +
@@ -3883,6 +3886,7 @@ pf_test_eth_rule(int dir, struct pfi_kkif *kif, struct mbuf **m0)
 		dst = (struct pf_addr *)&ip6->ip6_dst;
 		break;
 	}
+#endif /* INET6 */
 	}
 	e = mtod(m, struct ether_header *);
 	*m0 = m;