aboutsummaryrefslogtreecommitdiff
path: root/sys/netpfil/ipfw/dn_sched.h
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2016-06-21 13:48:49 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2016-06-21 13:48:49 +0000
commit89856f7e2d63bcaaacf105f679ade0bf5d40e821 (patch)
treef2fb0a7a66c6cdafb62dc189a1c8a15c38cdf22e /sys/netpfil/ipfw/dn_sched.h
parent1fe8c3077f04e1c570ad12ea120e15b9c9acbb93 (diff)
downloadsrc-89856f7e2d63bcaaacf105f679ade0bf5d40e821.tar.gz
src-89856f7e2d63bcaaacf105f679ade0bf5d40e821.zip
Get closer to a VIMAGE network stack teardown from top to bottom rather
than removing the network interfaces first. This change is rather larger and convoluted as the ordering requirements cannot be separated. Move the pfil(9) framework to SI_SUB_PROTO_PFIL, move Firewalls and related modules to their own SI_SUB_PROTO_FIREWALL. Move initialization of "physical" interfaces to SI_SUB_DRIVERS, move virtual (cloned) interfaces to SI_SUB_PSEUDO. Move Multicast to SI_SUB_PROTO_MC. Re-work parts of multicast initialisation and teardown, not taking the huge amount of memory into account if used as a module yet. For interface teardown we try to do as many of them as we can on SI_SUB_INIT_IF, but for some this makes no sense, e.g., when tunnelling over a higher layer protocol such as IP. In that case the interface has to go along (or before) the higher layer protocol is shutdown. Kernel hhooks need to go last on teardown as they may be used at various higher layers and we cannot remove them before we cleaned up the higher layers. For interface teardown there are multiple paths: (a) a cloned interface is destroyed (inside a VIMAGE or in the base system), (b) any interface is moved from a virtual network stack to a different network stack ("vmove"), or (c) a virtual network stack is being shut down. All code paths go through if_detach_internal() where we, depending on the vmove flag or the vnet state, make a decision on how much to shut down; in case we are destroying a VNET the individual protocol layers will cleanup their own parts thus we cannot do so again for each interface as we end up with, e.g., double-frees, destroying locks twice or acquiring already destroyed locks. When calling into protocol cleanups we equally have to tell them whether they need to detach upper layer protocols ("ulp") or not (e.g., in6_ifdetach()). Provide or enahnce helper functions to do proper cleanup at a protocol rather than at an interface level. Approved by: re (hrs) Obtained from: projects/vnet Reviewed by: gnn, jhb Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6747
Notes
Notes: svn path=/head/; revision=302054
Diffstat (limited to 'sys/netpfil/ipfw/dn_sched.h')
-rw-r--r--sys/netpfil/ipfw/dn_sched.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netpfil/ipfw/dn_sched.h b/sys/netpfil/ipfw/dn_sched.h
index 602fdf977388..ab32771ba0c3 100644
--- a/sys/netpfil/ipfw/dn_sched.h
+++ b/sys/netpfil/ipfw/dn_sched.h
@@ -196,6 +196,6 @@ int dn_sched_modevent(module_t mod, int cmd, void *arg);
#name, dn_sched_modevent, dnsched \
}; \
DECLARE_MODULE(name, name##_mod, \
- SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); \
+ SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY); \
MODULE_DEPEND(name, dummynet, 3, 3, 3)
#endif /* _DN_SCHED_H */