diff options
author | luigi <luigi@FreeBSD.org> | 2009-06-05 13:44:30 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2009-06-05 13:44:30 +0000 |
commit | 1384b62c4ba2ec9807b625311f416059f3a7aac0 (patch) | |
tree | c69eecd8f875c47b7a4ba27f5a37ac99ee98e78f /sys/net | |
parent | 2e85daee53850ca1d9c8acfa556ce08d31c9515a (diff) | |
download | FreeBSD-src-1384b62c4ba2ec9807b625311f416059f3a7aac0.zip FreeBSD-src-1384b62c4ba2ec9807b625311f416059f3a7aac0.tar.gz |
More cleanup in preparation of ipfw relocation (no actual code change):
+ move ipfw and dummynet hooks declarations to raw_ip.c (definitions
in ip_var.h) same as for most other global variables.
This removes some dependencies from ip_input.c;
+ remove the IPFW_LOADED macro, just test ip_fw_chk_ptr directly;
+ remove the DUMMYNET_LOADED macro, just test ip_dn_io_ptr directly;
+ move ip_dn_ruledel_ptr to ip_fw2.c which is the only file using it;
To be merged together with rev 193497
MFC after: 5 days
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_bridge.c | 4 | ||||
-rw-r--r-- | sys/net/if_ethersubr.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 276588b..f4551d1 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -3039,7 +3039,7 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) goto bad; } - if (IPFW_LOADED && pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) { + if (ip_fw_chk_ptr && pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) { INIT_VNET_INET(curvnet); error = -1; @@ -3058,7 +3058,7 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) if (*mp == NULL) return (error); - if (DUMMYNET_LOADED && (i == IP_FW_DUMMYNET)) { + if (ip_dn_io_ptr && (i == IP_FW_DUMMYNET)) { /* put the Ethernet header back on */ M_PREPEND(*mp, ETHER_HDR_LEN, M_DONTWAIT); diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 44f6b23..19122d6 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -432,7 +432,7 @@ ether_output_frame(struct ifnet *ifp, struct mbuf *m) INIT_VNET_NET(ifp->if_vnet); struct ip_fw *rule = ip_dn_claim_rule(m); - if (IPFW_LOADED && V_ether_ipfw != 0) { + if (ip_fw_chk_ptr && V_ether_ipfw != 0) { if (ether_ipfw_chk(&m, ifp, &rule, 0) == 0) { if (m) { m_freem(m); @@ -520,7 +520,7 @@ ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst, if (i == IP_FW_PASS) /* a PASS rule. */ return 1; - if (DUMMYNET_LOADED && (i == IP_FW_DUMMYNET)) { + if (ip_dn_io_ptr && (i == IP_FW_DUMMYNET)) { /* * Pass the pkt to dummynet, which consumes it. * If shared, make a copy and keep the original. @@ -766,7 +766,7 @@ ether_demux(struct ifnet *ifp, struct mbuf *m) * Allow dummynet and/or ipfw to claim the frame. * Do not do this for PROMISC frames in case we are re-entered. */ - if (IPFW_LOADED && V_ether_ipfw != 0 && !(m->m_flags & M_PROMISC)) { + if (ip_fw_chk_ptr && V_ether_ipfw != 0 && !(m->m_flags & M_PROMISC)) { struct ip_fw *rule = ip_dn_claim_rule(m); if (ether_ipfw_chk(&m, NULL, &rule, 0) == 0) { |