summaryrefslogtreecommitdiff
path: root/sbin/pfctl
AgeCommit message (Collapse)Author
2016-06-16allow include in inline anchorsHenning Brauer
with this, anchor foo { include "/path/to/rules" } works and "load anchor" is obsolete, to be removed somewhen later after release. co-production with reky at bsdcan, ok reyk mikeb benno sasha
2016-01-14detect multiple root queues on a single interface and give a nice errorHenning Brauer
message - beats "pfctl: DIOCXCOMMIT: Invalid argument". from Nathanael Rensen <nathanael at list.polymorpheus.com>, 10x! ok sthen phessler, commit reminder mikeb
2016-01-05remove long deprecated "set debug "none|urgent|misc|loud" levels inSebastian Benoit
pf.conf. Change this before upgrade or pf.conf won't load. florian@ henning@ phessler@ jung@
2015-12-10Remove NULL-checks before free(). ok tb@mmcc
2015-10-02Make 'pfctl -s all' show queues. pfctl(8) says it does, and 5.4Kenneth R Westerback
pfctl(8) did for the old queues. ok sashan@ sthen@
2015-09-03interface should only be specified for root queues; found by jsgMike Belopuhov
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-06-15document pfctl -ss -R <rule>, ok mikeb@Stuart Henderson
2015-06-12Allow rule ID filter to be specified for show states outputMike Belopuhov
Tweak pfctl to respect the rule ID parameter (-R) specified along with the show states (-s states) option to filter out states that are not associated with a given rule from the output. ok sthen, benno
2015-06-03Do not assume that asprintf() clears the pointer on failure, whichTodd C. Miller
is non-portable. Also add missing asprintf() return value checks. OK deraadt@ guenther@ doug@
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-02-07parse debug levels with strtonum, so that debug 1banana doesn't parse.Ted Unangst
ok mikeb
2015-01-21Include <netinet/in.h> before <net/pfvar.h>. In a future change whenTheo de Raadt
ports is ready, <net/pfvar.h> will stop including a pile of balony.
2015-01-20Rewrite to void using union sockaddr_unionTheo de Raadt
ok mikeb
2015-01-19DEFAULT_PRIORITY and DEFAULT_QLIMIT no longer usedTheo de Raadt
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-12-10If pfctl cannot set a limit in the kernel, print the name of theAlexander Bluhm
limit and the requested value. OK henning@
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-11-13keep queues around when anchors are being loadedMartin Pelikan
ok mikeb
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-05-07consolidate some code by using reallocarray in all cases.Ted Unangst
ok deraadt millert
2014-04-19remove altq bits here, tooHenning Brauer
(i was convinced i committed that yesterday already, hrm)
2014-04-11fix a use after free in an error pathJonathan Gray
ok henning@ mikeb@
2014-02-28Bring back the code removed in rev1.317 used to print anchors withMike Belopuhov
wildcard path ("ftp-proxy/*"), but make sure to call it after we're done with the ruleset for the current anchor. On one hand this repairs printing content of such anchors and on the other it allows to use a wildcard on the command line for anchors that were not initially specified with a wildcard. Makes pfctl regress happy again. OK henning, deraadt
2014-02-17Remove a stray debug printf that crept in via one of the newqueueLawrence Teo
commits. ok henning@
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
2014-01-19Fix minor ident issue. OK benno@, pelikan@Claudio Jeker
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-11-01keep net/hfsc.h away from userspace, except in pfctlpelikan
tested by naddy, ok deraadt
2013-10-28use %d instead of %i in a few fprintf for clarityTheo de Raadt
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-10-09Make sure that pfctl_state_store() frees the inbuf pointer and closesLawrence Teo
the state file before returning. ok henning
2013-08-12Remove duplicate and incorrect recursive anchor printing codeMike Belopuhov
and instead rely on the one provided by the same function just a few lines below. ok lteo henning
2013-08-02Remove an incorrect call to pfctl_print_rule_counters when trying toMike Belopuhov
print out anchor rules recursively; unbreaks pf1.loaded regress test. ok lteo, henning