summaryrefslogtreecommitdiff
path: root/sbin/pfctl/parse.y
AgeCommit message (Collapse)Author
2015-09-01- route-to, dup-to, reply-to should not override the block actionAlexandr Nedvedicky
Spotted by Dilli Paudel <dilli ! paudel at oracle ! com> ok jung@, ok mikeb@
2015-04-21Improve divert-to specification parsing w.r.t. rule address family.Mike Belopuhov
ok henning
2015-02-26%% not % in error message; ok millert@ henning@Stuart Henderson
2015-02-14Rather than using 0xff as a placeholder for "don't check prio", use 0xff toStuart Henderson
mean "prio is 0". This avoids the need for code changes in programs which add pf rules (as was done in pfctl but not other programs) to handle the new "check prio" functionality. Specifically this unbreaks ftp-proxy. Use of #define rather than magic 0xff suggested by benno. ok benno "if henning doesnt like it he can change it when he recovers from jet-lag"
2015-02-10since we inherit prio (as in, the queuing priority) from outside sources,Henning Brauer
i. e. on vlan interfaces, it is useful to be able to match on it - effectively matching on classification done elsewhere. i thought i had long implemented that, but chrisz@ asking for it made me notice that wasn't the case. tests by chrisz, ok phessler pelikan
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers whereTheo de Raadt
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
2014-12-19Support source-hash and random with tables and dynifs; not just pools.Reyk Floeter
This finally allows to use source-hash for dynamic loadbalancing, eg. "rdr-to <hosts> source-hash", instead of just round-robin and least-states. An older pre-siphash version of this diff was tested by many people. OK tedu@ benno@
2014-11-20Don't allow embedded nul characters in strings.Jonathan Gray
Fixes a pfctl crash with an anchor name containing an embedded nul found with the afl fuzzer. pfctl parse.y patch from and ok deraadt@
2014-10-27Fixup incorrect expansion of the networking mask for dynamic interfaceMike Belopuhov
specifications under certain circumstances resulting in potentially elevated access permissions for IPv6 traffic. Reported by sthen@; ok henning benno sthen
2014-10-25Remove unnecessary netinet/in_systm.h include.Lawrence Teo
ok millert@
2014-09-13Replace all queue *_END macro calls except CIRCLEQ_END with NULL.Doug Hogan
CIRCLEQ_* is deprecated and not called in the tree. The other queue types have *_END macros which were added for symmetry with CIRCLEQ_END. They are defined as NULL. There's no reason to keep the other *_END macro calls. ok millert@
2014-08-23when you specify queues in a rule, make sure they have been defined.Martin Pelikan
DIOCADDRULE EBUSY turns into an error message that pfctl -n catches. DIOCXCOMMIT EINVAL after the kernel rejected the rules was reported to occur, possibly from hfsc.c: this should be fixed as well. ok henning mikeb sthen
2014-08-21deny "once" flags for match rules; ok henningMike Belopuhov
2014-07-02condition above makes this part of the check useless;Mike Belopuhov
overlooked in the previous commit
2014-06-30Merge two loops in collapse_redirspec into oneMike Belopuhov
This lets us do the checks only once and also make smarter decisions about the rule's own address family. As a result af-to rules no longer need to specify the address family after 'pass'. ok henning
2014-06-25Make stricter decisions when handling translation specifications.Mike Belopuhov
In particular, disallow specifications containing addresses of different address families when rule doesn't specify one, for example "pass out nat-to { ::1 1.1.1.1 }" will now produce an error instead of silently picking one of the addresses. sthen and deraadt agree
2014-05-17When parsing a numerical value for the TOS bits, make sure that itAlexander Bluhm
is in a valid range. OK henning@
2014-04-19remove altq bits here, tooHenning Brauer
(i was convinced i committed that yesterday already, hrm)
2014-01-22relax the cfg file secrecy check slightly to allow group readabilityHenning Brauer
default permissions and mtree NOT changed. prodded by benno, ok phessler benno jmatthew theo pelikan florian
2014-01-21if_item can be "any" now.Henning Brauer
allows things like block out on $someif received-on any to prevent packets to get forwarded to $someif
2014-01-20support "!received-on <interface>", ok dlg bennoHenning Brauer
2013-11-25use u_char for buffers in yylex, for ctype callsSebastian Benoit
found by millert@, ok deraadt@
2013-11-22Whole bunch of (unsigned char) casts carefully added for ctype calls.Theo de Raadt
Careful second audit by millert
2013-10-17cannot have queue definitions inside anchors.Henning Brauer
don't attempt to load them and err out if we run into one ran into by Gregor Best <gbe@@ring0.de>, analysis & fix your's truly
2013-10-12config bits for the bandwidth shaping part of the new queueing subsystemHenning Brauer
syntax worked out with many in ljubljana using a whiteboard, testing & looking over by many, ok phessler sthen
2013-08-01Provide local implementations of if_nametoindex(3) and if_indextoname(3)Mike Belopuhov
that make use of the cache of addresses populated by the ifa_load on startup to save the trouble of calling expensive getaddrinfo(3) up to four times per rule. Performance wise this change provides a speed up factor of 20 with a 11k line ruleset on a machine with 150 VLANs and 250 IP addresses (20 seconds down to 1 in this case). "wow!" henning, ok benno, florian
2013-06-01remove set-tos backwards compat, moved into the set {} block a year agoHenning Brauer
ok ryan
2013-03-02When a PF rule contains 'set tos' *followed by* a scrub option, the tosStuart Henderson
value is changed to 0x00. Left-over from the previous implementation where set-tos was part of "scrub". Problem reported by Jason Mader, ok henning
2013-01-16for consistency with prio etc, the queue assignment really belongsHenning Brauer
into the set block. so make pfctl accept, print and the manpage document . match set queue foo instead of . match queue foo but keep accepting the old way without the explicit set. ok bob, man jmc
2012-10-18Disallow tables and interface address pools for rdr-to, nat-to andReyk Floeter
route-to with any other scheduling algorithms than round-robin or least-states. Before this change, pfctl accepted and loaded invalid address pools, eg. "rdr-to <table> source-hash", but it is not supported by the kernel and was silently ignored in operation. Also clarify the manpage a bit by mentioning that tables are only valid with round-robin or least-states. ok zinke@
2012-09-18prio 0 is valid, therefore, I chose an "impossible" value for prio meaningHenning Brauer
"not set" and used a PF_PRIO_NOTSET define for it. now that means that everything that creates a struct pf_rule doesn't get away with bzero'ing it, which turned out to be not so nice. so get rid of PF_PRIO_NOTSET, instead, make a rule+state flag PFSTATE_SETPRIO which indicates wether the prio should be set. ok benno claudio mikeb
2012-07-10Allow an implicit address family for af-to rules. If the addressAlexander Bluhm
family can be determined by the "from" or "to" parameter in the matching part, it is no longer necessary to specify "inet" or "inet6" there. OK henning@ mikeb@
2012-07-10set { ... } -> set ( ... )Henning Brauer
brought up by ryan, discussed with him and theo and they convinced me
2012-07-09fix some of the confusion we have in pf regarding filter criteria vsHenning Brauer
options that "write" to the packet by putting the latter in a set { } block. for now prio and tos, maintain set-tos backwards compat for the moment. "match set { prio 6, tos lowdelay }" "match set prio 6" from a discussion with ryan in tokyo a while ago, ok ryan phessler
2012-07-07remove incorrect check in pfctl preventing set-tos for ipvshit.Henning Brauer
the kernel has code to deal with set-tos and that crap. don't ask for details. stuart ok
2012-07-07rename prio in struct pf_rule and related structs to set_prio so it isHenning Brauer
utterly clear this is not a filter criteria but a packet modification thing. also preparation for upcoming changes, including one to unscrew this mess (I should not have to touch half the tree for this - ifixitlater) not user visible, ok gcc
2011-12-19unbreak rule optimizer; ok henning, looksMike Belopuhov
2011-12-12fixup af-to regression with match rulesMike Belopuhov
pfctl should not infer the af-to behavior from the af/naf difference. instead, we should be clear that this is an af-to rule. essentially this change converts FOM_AFTO marker into a rule flag PFRULE_AFTO so that we don't rely on ambiguous checks (like r->af != r->naf) when setting things up. positive review and comments from claudio, ok henning, sperreault
2011-12-03pfctl_set_hostid always returns 0; don't pretend otherwise and make it aRyan Thomas McBride
void function instead. ok dlg
2011-10-13pfctl change for af-to / NAT64 support.Claudio Jeker
The general syntax is: pass in inet from any to 192.168.1.1 af-to inet6 from 2001::1 to 2001::2 In the NAT64 case the "to" is not needed in af-to and the IP is extraced from the IPv6 dst (assuming a /64 prefix). Again most work by sperreault@, mikeb@ and reyk@ OK mcbride@, put it in deraadt@
2011-09-07Avoid possible SIGSEGV when wrong tos option.Christiano F. Haesbaert
2011-08-30One shot rules can be used in pf.conf by specifying a "once" filter option.Mike Belopuhov
ok henning, mcbride
2011-07-29Remove requirement to quote 'debug' loglevel for the 'debug' option.Ryan Thomas McBride
ok henning
2011-07-27Add support for weighted round-robin in load balancing pools and tables.Ryan Thomas McBride
Diff from zinke@ with a some minor cleanup. ok henning claudio deraadt
2011-07-13Force user to specify protocol when filtering on user, gid, and osRyan Thomas McBride
attributes (this is now required by pf_rule_test(). ok sthen henning
2011-07-08allow rules to specify "prio X" or "prio (X, Y)" to assign priority levelsHenning Brauer
for the new priority queueing implementation. valid range is 0 to 7. the old trick for priorizing empty ACKs etc remains thru the latter notation ok ryan mpf sthen plus pea testing and halex and claudio reading
2011-07-07Fold pf_test_fragment() into pf_test_rule(), reduce code and fixesRyan Thomas McBride
a bunch of bugs with fragment handling not being in sync with the rest of the ruleset. Much feedback from mpf, bluhm & markus Thanks to Tony Sarendal for help with testing ok bluhm; various previous versions ok henning, claudio, mpf, markus
2011-07-04bye bye require-order.Henning Brauer
i added that button many many many years ago since the order (options, scrub, nat, filter) was enforced back then, which I hated. now we had that turned off for ages, and with the scrub and nat rulesets being gone, there is very little reason to enforce an order at all. so let's get rid of it. introducing this button was one of my very early commits to openbsd... feels a bit strange to remove it now :) ok ryan dlg theo
2011-07-03g/c RIO traces (aka clean up after tedu :))Henning Brauer
2011-07-03bring in least-states load balancing algorithmJoerg Zinke
ok mcbride@ henning@