1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00
freebsd/sys/netinet6
Bjoern A. Zeeb 89856f7e2d 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
2016-06-21 13:48:49 +00:00
..
dest6.c
frag6.c sys/net*: minor spelling fixes. 2016-05-03 18:05:43 +00:00
icmp6.c Use Node Information flag names instead of hard-coding their values. 2016-05-15 03:22:13 +00:00
icmp6.h
in6_cksum.c
in6_fib.c MFP r287070,r287073: split radix implementation and route table structure. 2016-01-25 06:33:15 +00:00
in6_fib.h Merge helper fib* functions used for basic lookups. 2015-12-08 10:50:03 +00:00
in6_gif.c Use correct lookup key for gif route lookups. 2015-12-09 22:09:33 +00:00
in6_ifattach.c Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
in6_ifattach.h Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
in6_mcast.c sys/net*: minor spelling fixes. 2016-05-03 18:05:43 +00:00
in6_pcb.c This change re-adds L2 caching for TCP and UDP, as originally added in D4306 2016-06-02 17:51:29 +00:00
in6_pcb.h
in6_pcbgroup.c Unbreak the RSS/PCBGROUp build. 2016-03-31 00:53:23 +00:00
in6_proto.c The pr_destroy field does not allow us to run the teardown code in a 2016-06-01 10:14:04 +00:00
in6_rmx.c Code duplication but rib_head is special. Not found an easy way to go 2016-02-03 21:56:51 +00:00
in6_rss.c
in6_rss.h
in6_src.c Fix regression introduced in r296986. 2016-04-08 11:13:24 +00:00
in6_var.h Remove the SIOCSIFALIFETIME_IN6 ioctl. 2016-06-13 22:31:16 +00:00
in6.c Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
in6.h This change re-adds L2 caching for TCP and UDP, as originally added in D4306 2016-06-02 17:51:29 +00:00
ip6_ecn.h
ip6_forward.c Cleanup unneded include "opt_ipfw.h". 2016-06-09 05:48:34 +00:00
ip6_gre.c
ip6_id.c sys/net*: minor spelling fixes. 2016-05-03 18:05:43 +00:00
ip6_input.c Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
ip6_ipsec.c
ip6_ipsec.h
ip6_mroute.c Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
ip6_mroute.h
ip6_output.c Cleanup unneded include "opt_ipfw.h". 2016-06-09 05:48:34 +00:00
ip6_var.h The pr_destroy field does not allow us to run the teardown code in a 2016-06-01 10:14:04 +00:00
ip6.h
ip6protosw.h sys/net*: minor spelling fixes. 2016-05-03 18:05:43 +00:00
mld6_var.h
mld6.c Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
mld6.h
nd6_nbr.c Always start IPv6 DAD asynchronously. 2016-06-02 17:17:15 +00:00
nd6_rtr.c Exploit r301213 to fix in6 ifaddr locking in pfxlist_onlink_check(). 2016-06-02 17:21:57 +00:00
nd6.c Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
nd6.h Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
pim6_var.h
pim6.h
raw_ip6.c sys/net* : for pointers replace 0 with NULL. 2016-04-15 17:30:33 +00:00
raw_ip6.h
route6.c
scope6_var.h Merge helper fib* functions used for basic lookups. 2015-12-08 10:50:03 +00:00
scope6.c Add a missing newline to a log message. 2016-02-12 21:17:00 +00:00
sctp6_usrreq.c When a client uses UDP encapsulation and lists IP addresses in the INIT 2016-05-01 21:48:55 +00:00
sctp6_var.h Fix the ICMP6 handling for SCTP. 2016-04-16 21:34:49 +00:00
send.c These files were getting sys/malloc.h and vm/uma.h with header pollution 2016-02-01 17:41:21 +00:00
send.h
tcp6_var.h
udp6_usrreq.c Cleanup unneded include "opt_ipfw.h". 2016-06-09 05:48:34 +00:00
udp6_var.h