summaryrefslogtreecommitdiff
path: root/sbin/pfctl
AgeCommit message (Collapse)Author
2009-12-24spelling fixes, from Brad Tilley; we will not fix src/sbin/dump/dump.hIgor Sobrado
as neither arrayified not arrayfied exist -- sanctioned dictionaries like Merriam-Webster ones suggest a few alternatives (e.g., arrayed), however these made up words are easy to understand and we are not certain that current ones are not ok. ok jmc@
2009-12-24add support to pf for filtering a packet by the interface it was receivedDavid Gwynne
on. use the received-on IFNAME filter option on a pf.conf rule to restrict which packet the interface had to be received on. eg: pass out on em0 from $foo to $bar received-on fxp0 ive been running this in production for a week now. i find it particularly usefull with interface groups. no objections, and a few "i like"s from henning, claudio, deraadt, mpf
2009-12-14fix sticky-address - by pretty much re-implementing it. still followingHenning Brauer
the original approach using a source tracking node. the reimplementation i smore flexible than the original one, we now have an slist of source tracking nodes per state. that is cheap because more than one entry will be an absolute exception. ok beck and jsg, also stress tested by Sebastian Benoit <benoit-lists at fb12.de>
2009-12-10plug some memory leaks; found by parfait, ok henningTheo de Raadt
2009-11-23since "nat/rdr pass" are history natpass can goHenning Brauer
2009-11-22cleanup after the NAT changes. we used to have multiple rulesets (scrub,Henning Brauer
NAT, filter). now we only have one. no need for an array any more. simplifies the code quite a bit. in the process fix the abuse of PF_RULESET_* by (surprise, isn't it) the table code. written at the filesystem hackathon in stockholm, committed from the hardware hackathon in portugal. ok gcc and jsing
2009-11-09A few more places to be updated for the route pool change.Jonathan Gray
expanded version of a diff from Vadim Zhukov. ok henning@ claudio@
2009-11-03rtables are stacked on rdomains (it is possible to have multiple routingClaudio Jeker
tables on top of a rdomain) but until now our code was a crazy mix so that it was impossible to correctly use rtables in that case. Additionally pf(4) only knows about rtables and not about rdomains. This is especially bad when tracking (possibly conflicting) states in various domains. This diff fixes all or most of these issues. It adds a lookup function to get the rdomain id based on a rtable id. Makes pf understand rdomains and allows pf to move packets between rdomains (it is similar to NAT). Because pf states now track the rdomain id as well it is necessary to modify the pfsync wire format. So old and new systems will not sync up. A lot of help by dlg@, tested by sthen@, jsg@ and probably more OK dlg@, mpf@, deraadt@
2009-10-28Add a dedicated pf pool for route options as suggested by henning,Jonathan Gray
which unbreaks ie route-to after the recent pf changes. With much help debugging and pointing out of missing bits from claudio@ ok claudio@ "looks good" henning@
2009-10-28route_host initializes the netmask to a /128 no matter what af is used soClaudio Jeker
that the load balancing code does not freak out but because of this check_netmask() is now complaining. So set the addr.type to PF_ADDR_DYNIFTL so check_netmask() is fixing up the netmask for IPv4 and stops complaining. This is a partial fix for the failing regress test 13. found with jsg, looks good henning
2009-10-28Correct function name in err and errx.Claudio Jeker
2009-10-04Add (again) support for divert sockets. They allow you to:Michele Marchetto
- queue packets from pf(4) to a userspace application - reinject packets from the application into the kernel stack. The divert socket can be bound to a special "divert port" and will receive every packet diverted to that port by pf(4). The pf syntax is pretty simple, e.g.: pass on em0 inet proto tcp from any to any port 80 divert-packet port 1 A lot of discussion have happened since my last commit that resulted in many changes and improvements. I would *really* like to thank everyone who took part in the discussion especially canacar@ who spotted out which are the limitations of this approach. OpenBSD divert(4) is meant to be compatible with software running on top of FreeBSD's divert sockets even though they are pretty different and will become even more with time. discusses with many, but mainly reyk@ canacar@ deraadt@ dlg@ claudio@ beck@ tested by reyk@ and myself ok reyk@ claudio@ beck@ manpage help and ok by jmc@
2009-09-29sort usage();Jason McIntyre
2009-09-28add -S and -L options to store and load the pf state table from a file.David Gwynne
inspired by the short reboot times on an rb600a provided by stephan rickauer. testing and bugfixing by sthen@ ok mcbride@ sthen@
2009-09-08I had not enough oks to commit this diff.Michele Marchetto
Sorry.
2009-09-08Add support for divert sockets. They allow you to:Michele Marchetto
- queue packets from pf(4) to a userspace application - reinject packets from the application into the kernel stack. The divert socket can be bound to a special "divert port" and will receive every packet diverted to that port by pf(4). The pf syntax is pretty simple, e.g.: pass on em0 inet proto tcp from any to any port 80 divert-packet port 8000 test, bugfix and ok by reyk@ manpage help and ok by jmc@ no objections from many others.
2009-09-07implement binat-to as a macro-like rule: a rule using the new binat-toReyk Floeter
syntax will be expanded by the parser to a nat-to+rdr-to combination to be loaded into the kernel. this simplifies the migration from old binat rules and is less error-prone. feedback from many, manpage bits from jmc@ ok henning@
2009-09-03remove -N from usage();Jason McIntyre
2009-09-03this time i commit the right diff that wasReyk Floeter
ok henning@ (sorry)
2009-09-03fix two route-to vs. rdr-to conflicts.Reyk Floeter
found by sthen@ ok henning@
2009-09-03remove NAT specific command line optionsPeter Hessler
noticed by Wiktor Izdebski OK henning@
2009-09-02all the new *-to options are part of the "filteropts" section at theReyk Floeter
end of a pf rule (nat-to, divert-to, rdr-to, ...). take the historical chance to upgrade the grammar and move the route options to the filteropts section as well. for example, pass in on em0 route-to (em1 192.168.1.1) from 10.1.1.1 becomes pass in on em0 from 10.1.1.1 route-to (em1 192.168.1.1) many people like this including pyr@ mk@ kettenis@ todd@ and others ok henning@
2009-09-01the diff theo calls me insanae for:Henning Brauer
rewrite of the NAT code, basically. nat and rdr become actions on regular rules, seperate nat/rdr/binat rules do not exist any more. match in on $intf rdr-to 1.2.3.4 match out on $intf nat-to 5.6.7.8 the code is capable of doing nat and rdr in any direction, but we prevent this in pfctl for now, there are implications that need to be documented better. the address rewrite happens inline, subsequent rules will see the already changed addresses. nat / rdr can be applied multiple times as well. match in on $intf rdr-to 1.2.3.4 match in on $intf to 1.2.3.4 rdr-to 5.6.7.8 help and ok dlg sthen claudio, reyk tested too
2009-08-21remove the ``;'' at the end of INDENT() macro definition usingAlexandre Ratchov
the ``do { ... } while (0)'' construct. ok henning, from Frederic Culuot <frederic _at_ culot.org>
2009-07-28Bring back rev. 1.560:Claudio Jeker
Make it possible to use DiffServ Code Point in the TOS fields. Requested by deraadt@
2009-07-27When will people learn to commit their .h file changes?Theo de Raadt
2009-07-27Make it possible to use DiffServ Code Point in the TOS fields. Names likeClaudio Jeker
af11, cs6 and ef will now be mapped to the coresponding TOS value. OK henning@, sthen@, mcbride@
2009-07-09repair -xHenning Brauer
since all this stuff is transactional now we need to wrap that into DIOCXBEGIN/COMMIT. bad henning forgot to commit this chunk at c2k9
2009-05-14actually change the require-order default to No; I missed a part withStuart Henderson
my last commit. ok deraadt@
2009-04-26switch the require-order default to "no". regression tests still pass.Stuart Henderson
ok henning@ deraadt@
2009-04-25scrub_opts must not be empty, scrub on its own does nothing.Henning Brauer
noticed due to a question from otto@, ok regress/sbin/pfctl/ ;)
2009-04-16Really turn fragment reassembly on by default. pfctl must handle thisDavid Krause
since the DIOCSETREASS ioctl is called on every ruleset load and was overriding the initial setting in pfattach(). Fix setting of the global no-df bitmask as well. ok henning@
2009-04-15restore printing of the fragment option; ok henning@David Krause
2009-04-06print prettier, from sthen@Henning Brauer
2009-04-061) scrub rules are completely gone.Henning Brauer
2) packet reassembly: only one method remains, full reassembly. crop and drop-ovl are gone. . set reassemble yes|no [no-df] if no-df is given fragments (and only fragments!) with the df bit set have it cleared before entering the fragment cache, and thus the reassembled packet doesn't have df set either. it does NOT touch non-fragmented packets. 3) regular rules can have scrub options. . pass scrub(no-df, min-ttl 64, max-mss 1400, set-tos lowdelay) . match scrub(reassemble tcp, random-id) of course all options are optional. the individual options still do what they used to do on scrub rules, but everything is stateful now. 4) match rules "match" is a new action, just like pass and block are, and can be used like they do. opposed to pass or block, they do NOT change the pass/block state of a packet. i. e. . pass . match passes the packet, and . block . match blocks it. Every time (!) a match rule matches, i. e. not only when it is the last matching rule, the following actions are set: -queue assignment. can be overwritten later, the last rule that set a queue wins. note how this is different from the last matching rule wins, if the last matching rule has no queue assignments and the second last matching rule was a match rule with queue assignments, these assignments are taken. -rtable assignments. works the same as queue assignments. -set-tos, min-ttl, max-mss, no-df, random-id, reassemble tcp, all work like the above -logging. every matching rule causes the packet to be logged. this means a single packet can get logged more than once (think multiple log interfaces with different receivers, like pflogd and spamlogd) . almost entirely hacked at n2k9 in basel, could not be committed close to release. this really should have been multiple diffs, but splitting them now is not feasible any more. input from mcbride and dlg, and frantzen about the fragment handling. speedup around 7% for the common case, the more the more scrub rules were in use. manpage not up to date, being worked on.
2009-03-19pfctl -ss printed state levels for ICMPv6. Disable this the sameAlexander Bluhm
way it has already been done for ICMPv4. ok mcbride@
2009-02-23back out last commit since it breaks a few regress tests -- this will beTheo de Raadt
looked at post-release -- out of time for these kinds of problems david@ says: pfopt6 and f91.ok; pfopt6 change looks ok, but pf91 is of concern.
2009-02-19spacingTheo de Raadt
2009-02-16fix pfctl -v printing of anchors, from camield@. Closes user/6065Stuart Henderson
2008-10-17in findeol(), do not skip the pushback buffer. fixes PR 5952 by sthen@ andHenning Brauer
should make the pushback buffer really transparent. diagnosis by me, fix with mpf, some input deraadt, ok mpf
2008-10-02implement "set state-defaults X", where X is a list of state options asHenning Brauer
permitted keep state(X). applies to all rules which do not have keep state explicitely. e. g. "set state-defaults pflow, no-sync" ok phessler deraadt
2008-09-10do not try to print $$ when it has not been setTheo de Raadt
2008-09-09welcome pflow(4), a netflow v5 compatible flow export interface.Henning Brauer
flows export data gathered from pf states. initial implementation by Joerg Goltermann <jg@osn.de>, guidance and many changes by me. 'put it in' theo
2008-08-31avoid line wrap in usage() output;Jason McIntyre
2008-08-12use correct byte order when printing state expiration minutes; ok henning@David Krause
2008-08-07correctly copy the log interface spec when expanding an antispoof rule thatHenning Brauer
covers loopback addresses. ok ryan problem report from Harald Dunkel <harald.dunkel@aixigo.de>
2008-07-25don't redefine INFINITY -- math.h defines it nowMartynas Venckus
pointed out by, and ok david@, go ahead henning@
2008-07-24check sysctl return valueHenning Brauer
From: Gleydson Soares <gsoares@gmail.com>, ryan ok
2008-07-03do not forget to initialize other member of $$ in qname; noted by mark shroyerTheo de Raadt
ok henning
2008-06-29Simplify state creation code; merge state import/export code between pfsyncRyan Thomas McBride
and the state-related pf(4) ioctls, and make functions in state creation and destruction paths more robust in error conditions. All values in struct pfsync_state now in network byte order, as with pfsync. testing by david ok henning, systat parts ok canacar