Commit Graph

130 Commits

Author SHA1 Message Date
tls
4147a3c54a Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry.  RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros.  Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default.  Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
2007-05-28 12:06:17 +00:00
drochner
12f037f2be Re-add version.c which got lost in the update.
(This is not an official interface, but we want to be compatible.)
pointed out by Bernd Ernesti
2006-05-02 09:59:26 +00:00
drochner
741f357fc1 Build libpcap-0.9.4 from src/dist.
While there are some open issues, particulary wrt support of old
NetBSD-specific interfaces, it is better to get the code some public
testing before NetBSD-4 is branched.
2006-04-25 18:36:44 +00:00
drochner
897ac6b30b revert wrong fix to a non-existant problem
Don't believe Coverity blindly!
2006-03-20 15:43:14 +00:00
christos
2fd1a9105a Coverity CID 1515: Off-by-one and trash the stack... 2006-03-19 23:10:04 +00:00
drochner
ce0e370e9a use unsigned ints in filter, to avoid possible portability problems
with bit shifts,
this is part of PR lib/16518 by yamt
(the other concerns in that PR should be solved)
2006-02-24 23:41:50 +00:00
drochner
8f9b0acfe8 account for data alignment of FDDI packets;
this should fix PR bin/28531 by Geoff Adams
(we should import a libpcap 0.9 rather than hacking this to death)
2006-02-24 22:14:10 +00:00
wiz
b070717566 Remove break after goto (lint complains). 2006-02-07 20:13:22 +00:00
scw
795def8d0d Bump minor for pcap_inject() addition. 2005-10-01 09:55:27 +00:00
scw
f552876f7c Add a simplified pcap_inject() from libpcap-0.9.3.
Required for wpa_supplicant and hostapd tools.
2005-10-01 09:55:00 +00:00
dyoung
0ee313689a Fix bpf_open so that we can run tcpdump without write-access to
any of the /dev/bpf* device nodes.  In bpf_open, first try to open
each /dev/bpf* read-write; if that fails, try to open each read-only.
2005-06-10 19:00:09 +00:00
simonb
3cebd9325e White space nit- don't put a space before/after increment/decrement
operators.
2005-02-11 06:21:21 +00:00
lukem
7157011597 Only compile in IPv6 support if ${USE_INET6} != "no"
MKINET6 is for providing IPv6 infrastructure.
USE_INET6 is for compiling IPv6 support into the programs (needs MKINET6).
2005-01-10 02:58:58 +00:00
dyoung
81e590905d Bump minor version for libpcap 0.8.3 import.
Thanks Julian Coleman for pointing out my oversight.
2005-01-09 11:57:34 +00:00
christos
8d79e1b130 Use /dev/bpf. 2004-12-02 00:05:02 +00:00
he
1aba91b7c0 Move the conditional definition of offsetof() till after all the
headers have been included.  Fixes compile problem for vax.
2004-10-01 20:46:15 +00:00
wiz
ab8bec093c Another formatting fix. 2004-09-28 09:36:14 +00:00
wiz
4f07b22d09 Some formatting fixes, and s/OpenBSD/.Ox/ s/FreeBSD/.Fx/. 2004-09-28 09:33:53 +00:00
wiz
867837f34d Remove trailing whitespace. 2004-09-28 09:31:13 +00:00
dyoung
4776f99384 Make newchunk() prototype match definition. 2004-09-28 06:35:38 +00:00
dyoung
9a9445f102 Commit stragglers. 2004-09-27 23:03:15 +00:00
dyoung
c14b894413 Resolve conflicts in libpcap-0.8.3 import.
Remove some extraneous files.
2004-09-27 23:02:53 +00:00
dyoung
6c7d5c9634 Process the new files in libpcap 0.8.3.
Match the end-of-line after file extensions, so that *.[ch] files
with version numbers in their pathnames (e.g., libpcap-0.8.3/gencode.c)
do not match the manual-page regular expression.
2004-09-22 19:35:47 +00:00
dyoung
5c852952b0 Import libpcap 0.8.3 from tcpdump.org---getting it right this time, I hope. 2004-09-19 21:57:48 +00:00
dyoung
7e3909436f Import libpcap 0.8.3 from tcpdump.org 2004-09-19 21:31:39 +00:00
jrf
190b2e4c51 Replaced strncpy with strlcpy. Thanks to Peter Postma who
pointed them our in PR #25762. Approved by christos@NetBSD.org.
2004-09-07 13:20:39 +00:00
itojun
7a97c46b28 support format for if_pflog.c (new format only/old format not supported)
Peter Postma
2004-06-25 12:22:23 +00:00
jonathan
f0d1f46d5b Do runtime dynamic binary-search for maximum obtainable bpf capture
size (via BIOCSBLEN). Obtained from FreeBSD 4.x; originally from
http://www.tcpdump.org's version of libpcap.

Taken verbatim from the FreeBSD 4.9 version, lint and all, other than
increasing the maximum size from 32Kibyte to an extremely generous
4Mibytes.  We assume root will configure the in-kernel maximum value
sensibly on small-memory machines.
2004-01-20 23:31:20 +00:00
christos
6f8e24d360 prevent double free. From OpenBSD 2003-11-24 21:49:12 +00:00
lukem
a93ea220fc Rework how dependency generation is performed:
* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
  This is a change of behaviour.  If a Makefile wants the clean semantics
  it must specifically append to CLEANFILES.
  Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
  that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d  depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".
2003-08-01 17:03:41 +00:00
wiz
472351e13d Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
2003-04-16 13:34:34 +00:00
perry
1f4ad37fe3 "Utilize" has exactly the same meaning as "use," but it is more
difficult to read and understand. Most manuals of English style
therefore say that you should use "use".
2003-02-05 00:02:24 +00:00
pooka
9659091d7a Take descriptions for pcap_file() and pcap_fileno() from libpcap-current
man page. The previous descriptions were horribly wrong.
2003-01-07 16:51:20 +00:00
pooka
77c102d728 add missing " 2003-01-03 12:50:44 +00:00
pooka
606c1fd1c5 pcap_next() returns a const u_char* 2003-01-02 15:43:15 +00:00
hannken
9417652b46 Add support for VLAN (IEEE 802.1Q) frames.
Built after libpcap-0.7 from tcpdump-3.7.1.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
2002-12-19 16:33:47 +00:00
thorpej
6ac6a2a09f Open the BPF file descriptor as read-write. Some pcap-using programs
(notably, simulators) expect to be able to send packets on the descriptor,
as well as receive.
2002-10-19 22:03:44 +00:00
wiz
57a4de98d0 New sentence, new line. From Robert Elz. 2002-10-01 19:26:58 +00:00
wiz
0dcd30151d Fix two typos, and bump Dd for recent additions. 2002-09-25 00:30:24 +00:00
thorpej
bfd8b5c80d * Add support for DLT_IEEE802_11.
* When opening a live pcap, obtain the list of supported DLTs from
  the BPF.
* Add pcap_list_datalinks() to obtain a list of supported DLTs
  supported by the interface associated with the pcap descriptor.
* Add pcap_set_datalink() to set the current DLT of the pcap.
* Bump shlib 1.2 -> 1.3; new functions added.

From David Young <dyoung@ojctech.com>, with some minor changes by me.
2002-09-22 16:13:01 +00:00
thorpej
d1f71ac3e2 Don't override the definition of LEX. 2002-09-14 14:59:30 +00:00
yamt
d3538cc488 sync partly with tcpdump.org. ok'ed by itojun
patches #454 from yamt@mwd.biglobe.ne.jp
- avoid optimization involving subtract operations
- correct optimization of bitwise operations

TODO: re-introduce subtract optimization
2002-08-26 11:21:18 +00:00
lukem
ebb6fc9eb8 Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path (etc).
(Reduces make output by ~ 20%)
2002-08-19 09:41:27 +00:00
itojun
53ca62040c calloc() arg mistake. it's (nelem, size). from openbsd
sync w/tcpdump.org
2002-08-12 02:39:22 +00:00
wiz
9e98569eee Space before comment after #endif. 2002-05-16 19:57:22 +00:00
ross
814f296b77 Generate <>& symbolically. 2002-02-07 07:00:09 +00:00
lukem
c1b95c0073 explicitly set to WARNS?=1 2001-11-05 15:22:23 +00:00
wiz
b6d001fb58 Use .Dq for quoting, and fix a (double) typo and duplicate words.
Slight format improvement for errbuf.
2001-10-03 21:57:58 +00:00
wiz
331a133d4b Remove two unnecessary .Pps, and fix a xref. 2001-10-03 21:39:04 +00:00
gmcgarry
645f8fe35b mdoc'ify pcap.3 2001-10-03 20:58:31 +00:00