From a693d17b9985a03bd9b5108e890d669005ab41eb Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Wed, 16 Mar 2022 12:52:07 -0700 Subject: [PATCH] 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;