summaryrefslogtreecommitdiffstats
path: root/sys/modules/ipfw
Commit message (Collapse)AuthorAgeFilesLines
* IPDIVERT is a module now and tell the other parts of the kernel about it.andre2004-10-251-4/+0
| | | | IPDIVERT depends on IPFIREWALL being loaded or compiled into the kernel.
* Document how a standalone module can be built with divert(4) support.ru2004-08-261-0/+4
|
* Revert the last change to sys/modules/ipfw/Makefile and fix aru2004-08-261-5/+1
| | | | | | | standalone module build in a better way. Silence from: andre MFC after: 3 days
* Make this compile again in the standalone and the MODULES_WITH_WORLDimp2004-08-231-1/+5
| | | | | | environments. Chances are good that this doesn't produce a good module, but I leave the proper defaults to the dummy opt_* files to the author.
* Convert ipfw to use PFIL_HOOKS. This is change is transparent to userlandandre2004-08-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and preserves the ipfw ABI. The ipfw core packet inspection and filtering functions have not been changed, only how ipfw is invoked is different. However there are many changes how ipfw is and its add-on's are handled: In general ipfw is now called through the PFIL_HOOKS and most associated magic, that was in ip_input() or ip_output() previously, is now done in ipfw_check_[in|out]() in the ipfw PFIL handler. IPDIVERT is entirely handled within the ipfw PFIL handlers. A packet to be diverted is checked if it is fragmented, if yes, ip_reass() gets in for reassembly. If not, or all fragments arrived and the packet is complete, divert_packet is called directly. For 'tee' no reassembly attempt is made and a copy of the packet is sent to the divert socket unmodified. The original packet continues its way through ip_input/output(). ipfw 'forward' is done via m_tag's. The ipfw PFIL handlers tag the packet with the new destination sockaddr_in. A check if the new destination is a local IP address is made and the m_flags are set appropriately. ip_input() and ip_output() have some more work to do here. For ip_input() the m_flags are checked and a packet for us is directly sent to the 'ours' section for further processing. Destination changes on the input path are only tagged and the 'srcrt' flag to ip_forward() is set to disable destination checks and ICMP replies at this stage. The tag is going to be handled on output. ip_output() again checks for m_flags and the 'ours' tag. If found, the packet will be dropped back to the IP netisr where it is going to be picked up by ip_input() again and the directly sent to the 'ours' section. When only the destination changes, the route's 'dst' is overwritten with the new destination from the forward m_tag. Then it jumps back at the route lookup again and skips the firewall check because it has been marked with M_SKIP_FIREWALL. ipfw 'forward' has to be compiled into the kernel with 'option IPFIREWALL_FORWARD' to enable it. DUMMYNET is entirely handled within the ipfw PFIL handlers. A packet for a dummynet pipe or queue is directly sent to dummynet_io(). Dummynet will then inject it back into ip_input/ip_output() after it has served its time. Dummynet packets are tagged and will continue from the next rule when they hit the ipfw PFIL handlers again after re-injection. BRIDGING and IPFW_ETHER are not changed yet and use ipfw_chk() directly as they did before. Later this will be changed to dedicated ETHER PFIL_HOOKS. More detailed changes to the code: conf/files Add netinet/ip_fw_pfil.c. conf/options Add IPFIREWALL_FORWARD option. modules/ipfw/Makefile Add ip_fw_pfil.c. net/bridge.c Disable PFIL_HOOKS if ipfw for bridging is active. Bridging ipfw is still directly invoked to handle layer2 headers and packets would get a double ipfw when run through PFIL_HOOKS as well. netinet/ip_divert.c Removed divert_clone() function. It is no longer used. netinet/ip_dummynet.[ch] Neither the route 'ro' nor the destination 'dst' need to be stored while in dummynet transit. Structure members and associated macros are removed. netinet/ip_fastfwd.c Removed all direct ipfw handling code and replace it with the new 'ipfw forward' handling code. netinet/ip_fw.h Removed 'ro' and 'dst' from struct ip_fw_args. netinet/ip_fw2.c (Re)moved some global variables and the module handling. netinet/ip_fw_pfil.c New file containing the ipfw PFIL handlers and module initialization. netinet/ip_input.c Removed all direct ipfw handling code and replace it with the new 'ipfw forward' handling code. ip_forward() does not longer require the 'next_hop' struct sockaddr_in argument. Disable early checks if 'srcrt' is set. netinet/ip_output.c Removed all direct ipfw handling code and replace it with the new 'ipfw forward' handling code. netinet/ip_var.h Add ip_reass() as general function. (Used from ipfw PFIL handlers for IPDIVERT.) netinet/raw_ip.c Directly check if ipfw and dummynet control pointers are active. netinet/tcp_input.c Rework the 'ipfw forward' to local code to work with the new way of forward tags. netinet/tcp_sack.c Remove include 'opt_ipfw.h' which is not needed here. sys/mbuf.h Remove m_claim_next() macro which was exclusively for ipfw 'forward' and is no longer needed. Approved by: re (scottl)
* bring Makefile up to date with new ipfwjulian2002-06-281-1/+1
| | | | Submitted by: luigi
* Drop <bsd.man.mk> support from <bsd.kmod.mk>.ru2002-01-111-1/+0
| | | | Not objected to by: -current
* Use a consistent style and one much closer to the rest of /usr/srcobrien2001-01-061-1/+3
|
* Use .include <bsd.kmod.mk> to get to ../../*/conf/kmod.mk instead ofpeter2000-05-271-1/+1
| | | | encoding the relative path.
* Pull in sys/conf/kmod.mk, rather than /usr/share/mk/bsd.kmod.mk.peter2000-05-041-1/+1
| | | | | | | This means that the kernel can be totally self contained now and is not dependent on the last buildworld to update /usr/share/mk. This might also make it easier to build 5.x kernels on 4.0 boxes etc, assuming gensetdefs and config(8) are updated.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* No need to use a magic IPFIREWALL_MODULE - the build system suppliespeter1999-04-201-2/+2
| | | | one already we can test for.
* Sample initial set of kld-ified modules. Not all have been completelypeter1998-10-161-3/+3
| | | | | | | converted yet. These are more of a starting point. This is NOT connected to the parent Makefile. OK'ed by jkh (who is ever so patiently waiting)
* Add example for IPFIREWALL_DEFAULT_TO_ACCEPTpeter1997-09-101-1/+4
|
* Revert $FreeBSD$ back to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Use IPFIREWALL_MODULE instead of ACTUALLY_LKM_NOT_KERNEL to indicatebde1996-06-231-2/+3
| | | | | | | | | | LKM'ness. ACTUALLY_LKM_NOT_KERNEL is supposed to be so ugly that it only gets used until <machine/conf.h> goes away. bsd.kmod.mk should define a better-named general macro for this. Some places use PSEUDO_LKM. This is another bad name. Makefile: Added IPFIREWALL_VERBOSE_LIMIT option (commented out).
* Make the ipfw LKM work again.phk1996-02-241-3/+3
| | | | This concludes this round of updates to ipfw, have at it!
* Remove trailing whitespace.rgrimes1995-05-301-2/+2
|
* Checking new lkm structure..ugen1995-01-121-2/+2
|
* Firewall can be used as lkm module.To use itugen1995-01-121-0/+13
firewall should *NOT* be compiled into kernel. Then it can be loaded.This is misc module but i'v got no problemms with it,so shouldn't you i suppose.. BTW this is very stupid to have one module in CVS for ALL lkm's...
OpenPOWER on IntegriCloud