Commit Graph

48 Commits

Author SHA1 Message Date
christos e55a414b3e Don't write random data to the header. 2023-08-19 14:56:22 +00:00
rjs 14ae945a05 pflogd: adapt to new libpcap API. 2023-08-19 05:57:34 +00:00
mrg f8570f8a97 fix simple mis-matched function prototype and definitions.
most of these are like, eg

   void foo(int[2]);

with either of these

   void foo(int*) { ... }
   void foo(int[]) { ... }

in some cases (such as stat or utimes* calls found in our header files),
we now match standard definition from opengroup.

found by GCC 12.
2023-08-01 07:04:14 +00:00
andvar 7991f5a7b8 Fix all remaining typos, mainly in comments but also in few definitions and log messages, reported by me in PR kern/54889.
Also fixed some additional typos in comments, found on review of same files or typos.
2021-07-24 21:31:31 +00:00
joerg 5ce8b5422a Externalize variables owned logically by pf_ruleset.c 2020-04-22 23:40:40 +00:00
mrg 37649e4074 - enlarge buffer to avoid snprintf() truncation 2019-02-03 10:48:46 +00:00
sevan 453ff1f2f6 Escape Dx which otherwise gets interpreted as DragonFly.
via r1.49 in OpenBSD.
2018-08-07 21:11:19 +00:00
mrg fea0a40a90 fix two issues found by GCC 6.4:
- cbq_compute_idletime() had a fprintf() not in the intended missing {}.
- skip_cmp_dst_addr() compared a vs a instead of a vs b.
2018-02-04 08:44:36 +00:00
dholland 2c888f6181 PR 50709 David Binderman: memory leak 2016-05-30 17:21:07 +00:00
joerg b573c5e0d5 Fix obviously broken condition. 2015-08-28 12:17:41 +00:00
riastradh 6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
wiz a5684d07dd Use Mt for email addresses. 2013-07-20 21:39:55 +00:00
joerg efa013cb75 Fix format string usage. 2012-02-29 23:42:28 +00:00
mbalmer 24e4901256 There is no doubt whether whether should have a 'h' after the 'w'. 2011-10-17 16:35:21 +00:00
christos f4dfcf5469 warns=4 2010-12-13 01:45:38 +00:00
joerg bfbe4c3572 Use HUGE_VAL instead of INFINITY as positive infinity (or maximum value)
is good enough and the side effects of ISO C99 7.12 (4) are not desired.
2010-03-01 00:13:47 +00:00
minskim 0997da05f2 Correct the #ifdef test for struct ifdatareq. 2009-08-07 16:37:12 +00:00
christos 6c781e23d6 use the proper structure to get interface data. We depend on having the
NetBSD-specific ZIFDATA call to do the selection of the ioctl style.
From Patrick Welche.
2009-07-15 18:05:17 +00:00
minskim bea661fe98 Reduce diff with OpenBSD. No functional change. 2009-06-16 05:16:52 +00:00
perry 4bfc10355c add missing commas to .Dd fix, pointed out by wiz 2009-03-22 14:29:34 +00:00
perry c8a35b6227 OpenBSD uses a custom CVS hack to handle Dd fields ($Mdocdate$) which
we don't have. Replace ".Dd $Mdocdate" with ".Dd Month Day Year" so
that the date comes out right when man pages get built. This will
doubtless need hand conflict resolution whenever these pages are
re-imported.

Note that it would be interesting to have some similar facility for
NetBSD, but I don't think a custom rcs keyword is the right thing --
maybe we can teach groff to parse $Date$
2009-03-21 00:15:52 +00:00
yamt fff57c5525 merge yamt-pf42 branch.
(import newer pf from OpenBSD 4.2)

ok'ed by peter@.  requested by core@
2008-06-18 09:06:25 +00:00
dyoung f72063f0c8 Note NSF support. 2008-05-15 04:16:00 +00:00
matt e0eafe6e38 infile is const char *, not char * 2008-02-20 18:20:21 +00:00
matt ccfd1d4480 errbuf is [], not *. 2008-02-20 18:19:18 +00:00
tls 67fcd29261 Do not include internal header files from libpcap without setting the
feature-test macros they use.  Really, of course, this code should not
include such header files at all.
2007-05-28 11:55:19 +00:00
dyoung f7748bc6aa pfctl: extend pf.conf(5) syntax. Let the operator supply an optional
"state lock" flag (if-bound, gr-bound, floating) at the end of a
NAT rule.  The new syntax is backwards-compatbile with the old
syntax.

PF (kernel): change the macro BOUND_IFACE() to the inline function
bound_iface(), and add a new argument, the applicable NAT rule.
Use both the flags on the applicable filter rule and on the applicable
NAT rule to decide whether or not to bind a state to the interface
or the group where it is created.
2007-05-10 22:30:54 +00:00
peter dd191f37f3 Merge the peter-altq branch.
(sync with KAME & add support for using ALTQ with pf(4)).
2006-10-12 19:59:07 +00:00
christos 5e4126c34c Coverity CID 3498: Don't return after yyerror(); cleanup first. 2006-09-27 15:35:12 +00:00
peter 3942d3e2ab Revert previous and fix properly.
- The array must be NULL terminated because other code depends on it.
- Use this terminator to check if we're at the end of the array instead
  of doing sizeof(pf_timeouts) / sizeof(pf_timeouts[0]).
2006-07-03 20:26:19 +00:00
christos b2f6added5 Coverity CID 577: remove dead code; minburst can never be 0 at this point. 2006-03-21 20:49:54 +00:00
christos e46022bb52 Coverity CID 1514: Don't access static array beyond the end of it.
In this case PFTM_MAX == 20 and sizeof(pf_timeouts) / sizeof(pf_timeouts[0])
== 21, using a loop with the size of the array and checking for reaching the
end of the loop via j == PFTM_MAX does not work. Change the loop to use
PFTM_MAX as the upper bound and add an assertion in the code to make sure
that pf_timeouts is large enough. Finally remove last NULL element of the
array so that the array has 20 elements again.
2006-03-21 20:47:27 +00:00
christos 1a21d9be9f Coverity CID 2057: Don't forget to free tcpopts when you are done. 2006-03-21 20:31:56 +00:00
peter c4add27fee Fix a few Xrefs. 2005-08-07 01:05:51 +00:00
peter f9967d10c9 Resolve conflicts (pf from OpenBSD 3.7, userland part). 2005-07-01 12:43:50 +00:00
lukem 4952bc0ec3 appease gcc -Wuninitialized 2005-06-02 09:58:55 +00:00
peter 94921da3bb Changes to build on NetBSD:
* #ifdef out some things we don't have or do differently.
* Write struct "pcap_sf_pkthdr" instead of "pcap_pkthdr".
  Fixes an LP64 specific problem with reading the pflog with tcpdump(8).
  (OpenBSD fixed this by changing the structs to always use 32-bit fields)

Reviewed by yamt@.
2005-03-15 16:26:49 +00:00
yamt bc7b47989b a bug fix from OPENBSD_3_6.
> revision 1.2.2.1
> date: 2004/12/17 02:51:35;  author: brad;  state: Exp;  lines: +2 -2
> MFC:
> Fix by frantzen@
>
> &&/|| inversion would try to merge IP addresses with non-addresses into a
> single table causing a ruleset load error and eventually a double-free.
>
> ok deraadt@ mcbride@ henning@ frantzen@ dhartmei@
2004-12-19 10:27:46 +00:00
peter f7da5a456d Apply a patch from the OPENBSD_3_6 branch, ok itojun.
MFC:
Fix by dhartmei@

do not assume entries in pf_timeouts[] are ordererd like PFTM_* in pfvar.h
reported by Alexey E. Suslikov
2004-11-21 18:01:14 +00:00
yamt 23c8222edb merge after importing pf from openbsd 3.6. (userland part)
some files were imported to the different places from the previous version.
v3_5:
	etc/pf.conf
	etc/pf.os
	etc/spamd.conf
	share/man/man4/pf.4
	share/man/man4/pflog.4
	share/man/man5/pf.conf.5
	share/man/man5/pf.os.5
	share/man/man5/spamd.conf.5
v3_6:
	dist/pf/etc/pf.conf
	dist/pf/etc/pf.os
	dist/pf/etc/spamd.conf
	dist/pf/share/man/man4/pf.4
	dist/pf/share/man/man4/pflog.4
	dist/pf/share/man/man5/pf.conf.5
	dist/pf/share/man/man5/pf.os.5
	dist/pf/share/man/man5/spamd.conf.5
2004-11-14 11:26:43 +00:00
yamt 533d14a1b9 import pf from OpenBSD 3.6. (userland part) 2004-11-14 11:08:58 +00:00
dsl 26207dda78 Add (unsigned char) cast to ctype functions 2004-10-29 19:46:27 +00:00
wiz 94cdd0ee08 Add RCS Id. 2004-06-25 16:03:59 +00:00
wiz 5e18189b4a \*[Lt]\*[Gt] instead of "<>". Use ftp.NetBSD.org as example host. 2004-06-25 16:01:22 +00:00
hannken 5356e2c1a9 Resolve printf arg/type conflict on sparc64.
Fix PR #26030 and part of #26012
2004-06-24 11:05:10 +00:00
itojun 8bc0b4b95d escape from old-ALTQ and new-ALTQ difference 2004-06-23 04:38:43 +00:00
itojun ad399b67b8 PF from openbsd 3.5
massage pfctl to compile/run on netbsd.  put reachover makefile for pfctl
into src/sbin.
reviewed by matt, perry, christos
2004-06-22 15:16:29 +00:00
itojun 9e6c9caf46 PF from openbsd 3.5 2004-06-22 15:06:49 +00:00