Commit Graph

113 Commits

Author SHA1 Message Date
cy
f4880aada2 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
81062ad740 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
hselasky
34e8800cc7 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
hselasky
4d0bf8e5bb 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
hselasky
30f165e2d7 MFV r333789: libpcap 1.9.0 (pre-release)
MFC after:	1 month
Sponsored by:	Mellanox Technologies
2018-05-28 08:12:18 +00:00
sbruno
f56f1a929a 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
delphij
d3e56841f6 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
delphij
face0f2538 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
delphij
f719d5d44f MFV r313676: libpcap 1.8.1
MFC after:	1 month
2017-02-13 08:23:39 +00:00
jkim
ea71e54862 Fix a style(9) bug. 2016-08-03 20:21:58 +00:00
jkim
b1aed47516 Support nanosecond time stamps for pcap_dispatch(3) and pcap_loop(3). 2016-08-03 20:08:39 +00:00
pfg
f782132f22 libpcap: fix for simple NULL pointer dereference.
Found with devel/coccinelle.
2016-04-14 18:31:45 +00:00
delphij
fea8707db3 MFV r276759: libpcap 1.6.2.
MFC after:	1 month
2015-01-06 22:29:12 +00:00
luigi
9012a74511 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
kevlo
2d30c961db 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
sbruno
354fc81dc9 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
glebius
e352aa585e 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
glebius
4fe4e9732a 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
delphij
8be1d9016e MFV: libpcap 1.4.0.
MFC after:	4 weeks
2013-05-30 08:02:00 +00:00
hiren
9b71c4e88b 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
pfg
245e35ae97 Clean some 'svn:executable' properties in the tree.
Submitted by:	Christoph Mallon
MFC after:	3 days
2013-01-26 22:08:21 +00:00
delphij
a130b811b9 MFV: libpcap 1.3.0.
MFC after:	4 weeks
2012-10-05 18:42:50 +00:00
kevlo
98ccaea0f9 Fix typo: s/pakcet/packet 2012-09-20 03:29:43 +00:00
delphij
b6e0e7f97f 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
delphij
a3451bb93b Merge from vendor branch: update libpcap to 1.2.1.
MFC after:	2 weeks
2012-05-14 05:12:56 +00:00
delphij
009e986666 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
csjp
9c392f3f91 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
delphij
8c8d7206ec 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
rpaulo
e11759c217 Remove more unused files. 2010-10-29 18:56:51 +00:00
rpaulo
e2646b8f68 Remove unused files. 2010-10-29 18:50:38 +00:00
rpaulo
22f795f2fd Merge libpcap-1.1.1. 2010-10-29 18:43:23 +00:00
delphij
d9a0cd0982 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
delphij
8fed657163 Revert revision 199201 for now as it has introduced a kernel vulnerability
and requires more polishing.
2009-11-12 19:02:10 +00:00
delphij
13a19ef806 Add interface description capability as inspired by OpenBSD.
MFC after:	3 months
2009-11-11 21:30:58 +00:00
rpaulo
dc6531d9b1 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
rpaulo
9d4d27efa9 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
rpaulo
4e28805a1b 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
vanhu
d645281c28 Fixed indentation for LINKTYPE_ENC
Approved by:	gnn(mentor)
2009-03-24 15:57:35 +00:00
rpaulo
989ff00905 bpf_filter() and bpf_validate() can't live here if they already live in
bpf.h
2009-03-22 00:47:41 +00:00
rpaulo
46635ef154 Remove remaining references to BIOCSETBUFMODE ifdefs. We now have
another ifdef for zerocopy bpf.
2009-03-21 23:13:48 +00:00
rpaulo
12c773480a Finish merge of zerocopy bpf. 2009-03-21 23:08:04 +00:00
rpaulo
3f19af99ad Merge libpcap 1.0.0. 2009-03-21 22:58:08 +00:00
rpaulo
259f53ade9 Add Mac OS X stuff. 2009-03-21 20:39:22 +00:00
rpaulo
2a5dac1a1e Add a couple more paths. 2009-03-21 20:34:41 +00:00
rpaulo
fb140a5d54 Add exclude list for libpcap. 2009-03-21 20:16:15 +00:00
rpaulo
5779dabf1b Flatten vendor/libpcap and remove keyword expansion. 2009-03-20 13:44:43 +00:00
vanhu
8f8f965b49 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
csjp
2f23d207d3 Implement zero-copy bpf(4) buffer or "zbuf" support for libpcap. A slightly
different version has been committed upstream in the libpcap vendor branch.
This will allow people to experiment with zero-copy bpf(4) without requiring
external patches.

Note to enable this functionality:

    sysctl net.bpf.zerocopy_enable=1

By default, libpcap will use the legacy buffering method unless this sysctl
variable is set to 1.

For the details about zero-copy bpf(4) implementation see svn change r177548.

Requested by:		many
Discussed with:		sam
In collaboration with:	rwatson
2008-09-16 20:32:29 +00:00
mlaier
c89ca49410 Revert back to including the whole net/bpf.h again.
Requested by:	sam, nork
X-MFC after:	now
2007-10-20 20:23:39 +00:00
mlaier
298dfd4f74 Resolve merge conflicts
Approved by:	re (kensmith)
Obtained from:	tcpdump.org
2007-10-16 02:07:55 +00:00