1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-22 11:17:19 +00:00
freebsd/sys
Luigi Rizzo 2b25acc158 Remove (almost all) global variables that were used to hold
packet forwarding state ("annotations") during ip processing.
The code is considerably cleaner now.

The variables removed by this change are:

        ip_divert_cookie        used by divert sockets
        ip_fw_fwd_addr          used for transparent ip redirection
        last_pkt                used by dynamic pipes in dummynet

Removal of the first two has been done by carrying the annotations
into volatile structs prepended to the mbuf chains, and adding
appropriate code to add/remove annotations in the routines which
make use of them, i.e. ip_input(), ip_output(), tcp_input(),
bdg_forward(), ether_demux(), ether_output_frame(), div_output().

On passing, remove a bug in divert handling of fragmented packet.
Now it is the fragment at offset 0 which sets the divert status of
the whole packet, whereas formerly it was the last incoming fragment
to decide.

Removal of last_pkt required a change in the interface of ip_fw_chk()
and dummynet_io(). On passing, use the same mechanism for dummynet
annotations and for divert/forward annotations.

option IPFIREWALL_FORWARD is effectively useless, the code to
implement it is very small and is now in by default to avoid the
obfuscation of conditionally compiled code.

NOTES:
 * there is at least one global variable left, sro_fwd, in ip_output().
   I am not sure if/how this can be removed.

 * I have deliberately avoided gratuitous style changes in this commit
   to avoid cluttering the diffs. Minor stule cleanup will likely be
   necessary

 * this commit only focused on the IP layer. I am sure there is a
   number of global variables used in the TCP and maybe UDP stack.

 * despite the number of files touched, there are absolutely no API's
   or data structures changed by this commit (except the interfaces of
   ip_fw_chk() and dummynet_io(), which are internal anyways), so
   an MFC is quite safe and unintrusive (and desirable, given the
   improved readability of the code).

MFC after: 10 days
2002-06-22 11:51:02 +00:00
..
alpha Update an 'XXX what is this?' type comment about suswintr and fuswintr. 2002-06-20 07:40:53 +00:00
amd64 This commit adds basic support for the UFS2 filesystem. The UFS2 2002-06-21 06:18:05 +00:00
arm
boot Enable cd9660 support by default. 2002-06-21 22:34:51 +00:00
cam Correct spelling of 'supplied'. 2002-06-19 20:44:48 +00:00
coda
compat Add a comment about how we should use vn_open() here instead of directly 2002-06-14 07:24:01 +00:00
conf Remove CAPABILITIES from NOTES 2002-06-21 19:53:04 +00:00
contrib - Add sanity check for argument. 2002-06-12 14:55:19 +00:00
crypto
ddb Allow DB_SET() to set all fields in the ddb command structure. This 2002-06-05 19:00:02 +00:00
dev Add better mediaopt support for ibss and friends. 2002-06-19 17:37:34 +00:00
fs nmount'ify unionfs further by using separate options instead 2002-06-15 22:48:14 +00:00
geom Put geom_gpt.c under the GEOM option instead of having a special GEOM_GPT 2002-06-10 18:49:41 +00:00
gnu Use suword16/fuword16 instead of susword/fusword - this has two different 2002-06-20 07:23:08 +00:00
i4b Remote pci.h/NPCI usage from i4b code. 2002-06-13 06:04:28 +00:00
i386 This commit adds basic support for the UFS2 filesystem. The UFS2 2002-06-21 06:18:05 +00:00
ia64 Update an 'XXX what is this?' type comment about suswintr and fuswintr. 2002-06-20 07:40:53 +00:00
isa
isofs/cd9660
kern Always drop the p_args reference we held for copyout, even if we're about 2002-06-22 10:05:50 +00:00
libkern
modules A node that creates a device entry in /dev (yay devfs) 2002-06-18 21:32:33 +00:00
net Remove (almost all) global variables that were used to hold 2002-06-22 11:51:02 +00:00
netatalk Back out my lats commit of locking down a socket, it conflicts with hsu's work. 2002-05-31 11:52:35 +00:00
netatm - Turn a DIAGNOSTIC check into a KASSERT(9). 2002-06-17 06:10:17 +00:00
netgraph A node that creates a device entry in /dev (yay devfs) 2002-06-18 21:32:33 +00:00
netinet Remove (almost all) global variables that were used to hold 2002-06-22 11:51:02 +00:00
netinet6 Notify functions can destroy the pcb, so they have to return an 2002-06-14 08:35:21 +00:00
netipx Back out my lats commit of locking down a socket, it conflicts with hsu's work. 2002-05-31 11:52:35 +00:00
netkey Remove so*_locked(), which were backed out by mistake. 2002-06-18 07:42:02 +00:00
netnatm Back out my lats commit of locking down a socket, it conflicts with hsu's work. 2002-05-31 11:52:35 +00:00
netncp Back out my lats commit of locking down a socket, it conflicts with hsu's work. 2002-05-31 11:52:35 +00:00
netns Fix bug which has been there since rev 1.1 where && was used instead of &. 2002-06-09 03:57:34 +00:00
netsmb Back out my lats commit of locking down a socket, it conflicts with hsu's work. 2002-05-31 11:52:35 +00:00
nfs
nfsclient Back out my lats commit of locking down a socket, it conflicts with hsu's work. 2002-05-31 11:52:35 +00:00
nfsserver Back out my lats commit of locking down a socket, it conflicts with hsu's work. 2002-05-31 11:52:35 +00:00
pc98 MFi386: revisions from 1.342 to 1.344 2002-06-19 13:47:53 +00:00
pccard hw.pcic.ignore_pci 2002-06-13 17:28:55 +00:00
pci Fix typo in the BSD copyright: s/withough/without/ 2002-06-02 20:05:59 +00:00
posix4
powerpc Deorbit suibyte(). It was only used for split address space systems 2002-06-20 07:13:35 +00:00
rpc
security/lomac Get rid of warnings, there's no need to do preprocessor concatination of 2002-06-01 18:45:33 +00:00
sparc64 {f,s}usword -> {f,s}uword16. Implement {f,s}uword32. 2002-06-20 20:41:57 +00:00
sys Define an mbuf type, MT_TAG, used for volatile annotations 2002-06-22 11:29:08 +00:00
tools
ufs This commit adds basic support for the UFS2 filesystem. The UFS2 2002-06-21 06:18:05 +00:00
vm o Replace GIANT_REQUIRED in swap_pager_alloc() by the acquisition and 2002-06-22 08:03:21 +00:00
Makefile