diff options
author | phk <phk@FreeBSD.org> | 2005-04-19 09:56:14 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-04-19 09:56:14 +0000 |
commit | fe23bbf2260c81df872347e83b6169148f96612d (patch) | |
tree | 10ceab6a9c4c6dbf6f1711a901ac1e15e5f64b31 /sys | |
parent | 81affad3beec3556a1ecf7791fe42952e17467b1 (diff) | |
download | FreeBSD-src-fe23bbf2260c81df872347e83b6169148f96612d.zip FreeBSD-src-fe23bbf2260c81df872347e83b6169148f96612d.tar.gz |
Make IPFIREWALL compile without INET6
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/ip_fw2.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c index 97f27ca..6255bc2 100644 --- a/sys/netinet/ip_fw2.c +++ b/sys/netinet/ip_fw2.c @@ -36,6 +36,7 @@ #include "opt_ipfw.h" #include "opt_ipdn.h" #include "opt_inet.h" +#include "opt_inet6.h" #include "opt_ipsec.h" #ifndef INET #error IPFIREWALL requires INET. @@ -559,6 +560,7 @@ verify_path(struct in_addr src, struct ifnet *ifp) return 1; } +#ifdef INET6 /* * ipv6 specific rules here... */ @@ -637,6 +639,8 @@ hash_packet6(struct ipfw_flow_id *id) } /* end of ipv6 opcodes */ +#endif /* INET6 */ + static u_int64_t norule_counter; /* counter for ipfw_log(NULL...) */ #define SNPARGS(buf, len) buf + len, sizeof(buf) > len ? sizeof(buf) - len : 0 @@ -854,8 +858,12 @@ hash_packet(struct ipfw_flow_id *id) { u_int32_t i; - i = IS_IP6_FLOW_ID(id) ? hash_packet6(id): - (id->dst_ip) ^ (id->src_ip) ^ (id->dst_port) ^ (id->src_port); +#ifdef INET6 + if (IS_IP6_FLOW_ID(id)) + i = hash_packet6(id): + else +#endif /* INET6 */ + i = (id->dst_ip) ^ (id->src_ip) ^ (id->dst_port) ^ (id->src_port); i &= (curr_dyn_buckets - 1); return i; } @@ -2424,6 +2432,7 @@ check_body: icmptype_match(ICMP(ulp), (ipfw_insn_u32 *)cmd) ); break; +#ifdef INET6 case O_ICMP6TYPE: match = is_ipv6 && offset == 0 && proto==IPPROTO_ICMPV6 && @@ -2431,6 +2440,7 @@ check_body: ICMP6(ulp)->icmp6_type, (ipfw_insn_u32 *)cmd); break; +#endif /* INET6 */ case O_IPOPT: match = (hlen > 0 && @@ -2576,9 +2586,12 @@ check_body: /* XXX BED: verify_path was verify_rev_path in the diff... */ match = ((oif != NULL) || (m->m_pkthdr.rcvif == NULL) || - (is_ipv6 ? + ( +#ifdef INET6 + is_ipv6 ? verify_rev_path6(&(args->f_id.src_ip6), m->m_pkthdr.rcvif) : +#endif verify_path(src_ip, m->m_pkthdr.rcvif))); break; @@ -2640,6 +2653,7 @@ check_body: } break; +#ifdef INET6 case O_IP6_SRC_ME: match= is_ipv6 && search_ip6_addr_net(&args->f_id.src_ip6); break; @@ -2662,6 +2676,7 @@ check_body: case O_IP6: match = is_ipv6; break; +#endif /* * The second set of opcodes represents 'actions', |