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/netinet/ip_fw2.c | |
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/netinet/ip_fw2.c')
-rw-r--r-- | sys/netinet/ip_fw2.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c index 965cddb..65a2e26 100644 --- a/sys/netinet/ip_fw2.c +++ b/sys/netinet/ip_fw2.c @@ -3603,6 +3603,12 @@ remove_rule(struct ip_fw_chain *chain, struct ip_fw *rule, return n; } +/* + * Hook for cleaning up dummynet when an ipfw rule is deleted. + * Set/cleared when dummynet module is loaded/unloaded. + */ +void (*ip_dn_ruledel_ptr)(void *) = NULL; + /** * Reclaim storage associated with a list of rules. This is * typically the list created using remove_rule. @@ -3614,7 +3620,7 @@ reap_rules(struct ip_fw *head) while ((rule = head) != NULL) { head = head->next; - if (DUMMYNET_LOADED) + if (ip_dn_ruledel_ptr) ip_dn_ruledel_ptr(rule); free(rule, M_IPFW); } |