summaryrefslogtreecommitdiffstats
path: root/sys/netpfil/ipfw/ip_fw_nat.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2016-06-30 15:01:07 +0000
committerbz <bz@FreeBSD.org>2016-06-30 15:01:07 +0000
commit0c1171f994c5ad66aa192de0cc43b326e8cee144 (patch)
tree0226109929013a43480d069000c5f5a39c8521b4 /sys/netpfil/ipfw/ip_fw_nat.c
parentb281d573a9937cf7f6f8aebd506d4b39a067209c (diff)
downloadFreeBSD-src-0c1171f994c5ad66aa192de0cc43b326e8cee144.zip
FreeBSD-src-0c1171f994c5ad66aa192de0cc43b326e8cee144.tar.gz
Virtualise ipfilter.
Split initializzation an teardown into module (global state) and VNET (per virtual network stack) parts. Virtualise global state, which is not "const". Cleanup eventhandlers, so that we can make use of the passed in argument to get the vnet state from the ifp; disable the "cloner" event as it is too early, has no state, and can fire before initialisation (see comment in the source). Handle the dynamic sysctls specially. The problem is that "ipmain" is the virtualized struct, but the fields used for the sysctls are hanging off memory allocated and attached to the virtualized "ipmain" thus standard VNET macros and sysctl handling do not work. We still say it is VNET sysctls to get the proper protection checks in the VIMAGE case; to solve the problem of accessing the right bit of memory hanging of each per-VNET ipmain, we use a dedicated handler function wrapping around sysctl_ipf_int() undoing the base calculation from kern_sysctl.c and then adding the passed-in offset into the right struct depending on handler. A bit of a mess exposing VNET-internals this way but the only way to keep the code without having to massively restructure ipf internals. Approved by: re (hrs) Sponsored by: The FreeBSD Foundation Obtained from: projects/vnet MFC after: 2 weeks Reviewed by: cy Differential Revision: https://reviews.freebsd.org/D7000
Diffstat (limited to 'sys/netpfil/ipfw/ip_fw_nat.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud