Commit graph

115 commits

Author SHA1 Message Date
Joseph Mingrone dd744a896b libpcap: Update to 1.10.4
Changelog:	https://git.tcpdump.org/libpcap/blob/104271ba4a14de6743e43bcf87536786d8fddea4:/CHANGES
Reviewed by:	emaste
Obtained from:	https://www.tcpdump.org/release/libpcap-1.10.4.tar.gz
Sponsored by:	The FreeBSD Foundation
2023-05-05 10:56:10 -03:00
Joseph Mingrone 6f9cba8f8b
libpcap: Update to 1.10.3
Local changes:

- In contrib/libpcap/pcap/bpf.h, do not include pcap/dlt.h.  Our system
  net/dlt.h is pulled in from net/bpf.h.
- sys/net/dlt.h: Incorporate changes from libpcap 1.10.3.
- lib/libpcap/Makefile: Update for libpcap 1.10.3.

Changelog:	https://git.tcpdump.org/libpcap/blob/95691ebe7564afa3faa5c6ba0dbd17e351be455a:/CHANGES
Reviewed by:	emaste
Obtained from:	https://www.tcpdump.org/release/libpcap-1.10.3.tar.gz
Sponsored by:	The FreeBSD Foundation
2023-03-31 16:02:22 -03:00
Joseph Mingrone 6d1c946e91
libpcap: Make pcap/bpf.h a wrapper around system net/bpf.h
In the past, we modified pcap/pcap.h to include the system net/bpf.h
rather than libpcap's own pcap/bpf.h.  However, starting around 1.10.2,
libpcap requires a few extern functions defined in pcap/bpf.h to build.
Simply reverting that local change and pulling in pcap/bpf.h is not a
solution, because some ports with '#include <pcap.h>' such as mail/spamd
and net/xprobe require the system net/bpf.h to be pulled in.  To
accommodate both requirements, make pcap/bpf.h a wrapper around the
system net/bpf.h, but retain the extern function definitions.  This is
in preparation for libpcap 1.10.3.

Approved by:	cy, philip, emaste, delphij (earlier revision)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38575
2023-02-16 11:37:51 -04:00
Cy Schubert 31bfaf17a7 MFV r355890:
Fix libpcap issue #893: check for invalid IPv4 addresses.

This fixes errors such as:

tcpdump -i lagg0 net 999.999.999.999

This was originally discovered on a Red Hat 7.7 server and verified
to also be a bug on FreeBSD.

Obtained from:	https://github.com/the-tcpdump-group/libpcap/commit/ \
		07070918d5e81a515315b395f334e52589fe0fb
Fixed by:	https://github.com/guyharris
MFC after:	2 weeks
2019-12-21 21:05:53 +00:00
Cy Schubert 57e22627f9 MFV r353141 (by phillip):
Update libpcap from 1.9.0 to 1.9.1.

MFC after:	2 weeks
2019-12-21 21:01:03 +00:00
Hans Petter Selasky 5fd1ea0810 Re-apply r190640.
- Restore local change to include <net/bpf.h> inside pcap.h.
This fixes ports build problems.
- Update local copy of dlt.h with new DLT types.
- Revert no longer needed <net/bpf.h> includes which were added
as part of r334277.

Suggested by:	antoine@, delphij@, np@
MFC after:	3 weeks
Sponsored by:	Mellanox Technologies
2018-05-31 09:11:21 +00:00
Hans Petter Selasky 65b806b289 Hide unsupported remote capture definitions to avoid breakage in ports.
Suggested by:	antoine@
MFC after:	3 weeks
Sponsored by:	Mellanox Technologies
2018-05-30 11:45:29 +00:00
Hans Petter Selasky b00ab7548b MFV r333789: libpcap 1.9.0 (pre-release)
MFC after:	1 month
Sponsored by:	Mellanox Technologies
2018-05-28 08:12:18 +00:00
Sean Bruno 4b85e937ef Clear clang warning:
warning: macro expansion producing 'defined' has undefined behavior
  [-Wexpansion-to-defined]

Submitted by:	Aaron Prieger <aprieger@llnw.com>
Reviewed by:	dim
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D11166
2017-07-03 19:49:25 +00:00
Xin LI e39babf8f7 MFV r316124: Fix build when WITHOUT_INET6.
Reported by:	Randy Westlund <rwestlun gmail com>
MFC after:	3 days
2017-03-29 03:36:26 +00:00
Xin LI b86fcc147f MFV r313759: license change for a few headers (4 clause BSD to 3 clause BSD).
MFC after:	28 days
X-MFC-with:	r313695
2017-02-15 07:22:47 +00:00
Xin LI ada6f083b9 MFV r313676: libpcap 1.8.1
MFC after:	1 month
2017-02-13 08:23:39 +00:00
Jung-uk Kim 9c46493e50 Fix a style(9) bug. 2016-08-03 20:21:58 +00:00
Jung-uk Kim a4d10fa904 Support nanosecond time stamps for pcap_dispatch(3) and pcap_loop(3). 2016-08-03 20:08:39 +00:00
Pedro F. Giffuni ab341f7afd libpcap: fix for simple NULL pointer dereference.
Found with devel/coccinelle.
2016-04-14 18:31:45 +00:00
Xin LI 681ed54caa MFV r276759: libpcap 1.6.2.
MFC after:	1 month
2015-01-06 22:29:12 +00:00
Luigi Rizzo 86f82ef946 Add netmap support to libpcap. Tcpdump and other native pcap application can now
run directly on netmap ports using netmap:foo or valeXX:YY device names.
Modifications to existing code are small and trivial, the netmap-specific
code is all in a new file.

Please be aware that in netmap mode the physical interface is disconnected from
the host stack, so libpcap will steal the traffic not just make a copy.

For the full version of the code (including linux and autotools support) see
	https://code.google.com/p/netmap-libpcap/

MFC after:	3 days
2014-10-06 15:48:28 +00:00
Kevin Lo 5945b5f5ab Rename definition of IEEE80211_FC1_WEP to IEEE80211_FC1_PROTECTED.
The origin of WEP comes from IEEE Std 802.11-1997 where it defines
whether the frame body of MAC frame has been encrypted using WEP
algorithm or not.
IEEE Std. 802.11-2007 changes WEP to Protected Frame, indicates
whether the frame is protected by a cryptographic encapsulation
algorithm.

Reviewed by:	adrian, rpaulo
2014-01-08 08:06:56 +00:00
Sean Bruno 3055dc3e48 Integrate github revision 0446821e49224c6a29be28760cc9c4cc14f56d8a as
suggested by upstream

https://github.com/the-tcpdump-group/libpcap/issues/327

Quiesce assignment warnings by use of const
2013-10-31 20:03:59 +00:00
Gleb Smirnoff 75bf2db380 Move new pf includes to the pf directory. The pfvar.h remain
in net, to avoid compatibility breakage for no sake.

The future plan is to split most of non-kernel parts of
pfvar.h into pf.h, and then make pfvar.h a kernel only
include breaking compatibility.

Discussed with:		bz
2013-10-27 16:25:57 +00:00
Gleb Smirnoff 9dae57e134 Start splitting pfvar.h into internal and external parts.
- Provide pf_altq.h that has only stuff needed for ALTQ.
- Start pf.h, that would have all constant values and
  eventually non-kernel structures.
- Build ALTQ w/o pfvar.h, include if_var.h, that before
  came via pollution.
- Build tcpdump w/o pfvar.h.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-26 18:59:58 +00:00
Xin LI edc89b24f3 MFV: libpcap 1.4.0.
MFC after:	4 weeks
2013-05-30 08:02:00 +00:00
Hiren Panchasara a385d0b340 Add tcp header flags ECE and CWR defined in RFC 3168.
PR:	140349
Submitted by:	Alan Amesbury <amesbury@umn.edu> (earlier version)
Reviewed by:	delphij
Approved by:	sbruno (mentor)
2013-05-16 05:16:56 +00:00
Pedro F. Giffuni 646a7fea0c Clean some 'svn:executable' properties in the tree.
Submitted by:	Christoph Mallon
MFC after:	3 days
2013-01-26 22:08:21 +00:00
Xin LI 15752fa858 MFV: libpcap 1.3.0.
MFC after:	4 weeks
2012-10-05 18:42:50 +00:00
Kevin Lo b7e1113e8f Fix typo: s/pakcet/packet 2012-09-20 03:29:43 +00:00
Xin LI 206a88b211 Add 3 missing files that was generated but not included with the initial
commit.

Reported by:	buganini via IRC
MFC after:	2 weeks
2012-05-14 09:32:10 +00:00
Xin LI d1e8733132 Merge from vendor branch: update libpcap to 1.2.1.
MFC after:	2 weeks
2012-05-14 05:12:56 +00:00
Xin LI c62908a982 Incorporate vendor commit ecdc5c0a7f7591a7cd4a:
In userland, sign extend the offset for JA instructions.

We currently use that to implement "ip6 protochain", and "pc" might be
wider than "pc->k", in which case we need to arrange that "pc->k" be
sign-extended, by casting it to bpf_int32.

PR:		kern/157188
Submitted by:	plosher
MFC after:	2 weeks
2011-06-28 00:58:12 +00:00
Christian S.J. Peron e375b20400 Explicitly initialize the packet buffer to NULL after we unmap the zero copy
buffers.  This fixes a segfault on exit due to calling free on a bogus pointer.
This should be considered a temporary stop gap fix to avoid the crash.  The
complete fix re-shuffles the initializations of some of the clean-up pointers.

The details of the fix can be found in the libpcap git repository:
commit bc8209b71e928870b0f172d43b174ab27ba24394

Proded by:	kevlo, rpaulo
MFC after:	2 weeks
Submitted by:	Anton Yuzhaninov
2011-06-03 14:57:38 +00:00
Xin LI 9a7836dce1 Merge my change against libpcap trunk revision
c65292b04b98d6a76d58c5a54ca8f81463bf24de to support new SIOCGIFDESCR
ioctl interface which was too late for libpcap 1.1.1.

Reported by:	brucec
Noticed by:	wxs
2011-03-11 00:38:07 +00:00
Rui Paulo b436d954c4 Remove more unused files. 2010-10-29 18:56:51 +00:00
Rui Paulo 6aa7d503ce Remove unused files. 2010-10-29 18:50:38 +00:00
Rui Paulo a0ee43a18d Merge libpcap-1.1.1. 2010-10-29 18:43:23 +00:00
Xin LI 215940b3fa Revised revision 199201 (add interface description capability as inspired
by OpenBSD), based on comments from many, including rwatson, jhb, brooks
and others.

Sponsored by:	iXsystems, Inc.
MFC after:	1 month
2010-01-27 00:30:07 +00:00
Xin LI 1a9d4dda9b Revert revision 199201 for now as it has introduced a kernel vulnerability
and requires more polishing.
2009-11-12 19:02:10 +00:00
Xin LI 41c8c6e876 Add interface description capability as inspired by OpenBSD.
MFC after:	3 months
2009-11-11 21:30:58 +00:00
Rui Paulo efbbe93e56 Revert previous commit that commented out some bpf functions.
Unconstify arguments of bpf_image(), bpf_filter() and bpf_dump(). This
is needed because some ports rely heavely on these arguments (some of
them even roll out their own implemenentations of bpf_dump).
2009-04-11 17:36:11 +00:00
Rui Paulo 0c9438135a Restore local change to include <sys/bpf.h> inside pcap.h. This fixes
remaining ports build problems.
2009-04-02 13:04:17 +00:00
Rui Paulo fa01cfefc2 Remove a dangling extern "C" declaration that was missed during the
merge. Fixes C++ ports using libpcap (nmap, for example).

Submitted by:	Daniel Roethlisberger <daniel at roe.ch>
2009-03-31 11:04:51 +00:00
VANHULLEBUS Yvan ff1fdd77ff Fixed indentation for LINKTYPE_ENC
Approved by:	gnn(mentor)
2009-03-24 15:57:35 +00:00
Rui Paulo 1d111e6dfe bpf_filter() and bpf_validate() can't live here if they already live in
bpf.h
2009-03-22 00:47:41 +00:00
Rui Paulo b2e0e80d0c Remove remaining references to BIOCSETBUFMODE ifdefs. We now have
another ifdef for zerocopy bpf.
2009-03-21 23:13:48 +00:00
Rui Paulo 2676a4aff3 Finish merge of zerocopy bpf. 2009-03-21 23:08:04 +00:00
Rui Paulo a8e0710125 Merge libpcap 1.0.0. 2009-03-21 22:58:08 +00:00
Rui Paulo e744b7e395 Add Mac OS X stuff. 2009-03-21 20:39:22 +00:00
Rui Paulo 4eea7c44d8 Add a couple more paths. 2009-03-21 20:34:41 +00:00
Rui Paulo 4953d4b64d Add exclude list for libpcap. 2009-03-21 20:16:15 +00:00
Rui Paulo 3430dc7c1f Flatten vendor/libpcap and remove keyword expansion. 2009-03-20 13:44:43 +00:00
VANHULLEBUS Yvan ef39bc9f18 Added DLT_ENC to map list, so it is now possible
to save dumps on enc0

Reviewed by:	gnn(mentor)
Obtained from:	NETASQ
MFC after:	1 week
2009-03-16 15:09:47 +00:00