Commit Graph

23 Commits

Author SHA1 Message Date
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
Rui Paulo
a0ee43a18d Merge libpcap-1.1.1. 2010-10-29 18:43:23 +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
3430dc7c1f Flatten vendor/libpcap and remove keyword expansion. 2009-03-20 13:44:43 +00:00
Christian S.J. Peron
154bbe416c 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
Max Laier
5357e0fedb Resolve merge conflicts
Approved by:	re (kensmith)
Obtained from:	tcpdump.org
2007-10-16 02:07:55 +00:00
Max Laier
ef96d74f8a Import of libpcap v0.9.8 2007-10-16 02:02:02 +00:00
Jung-uk Kim
560a54e10c Add three new ioctl(2) commands for bpf(4).
- BIOCGDIRECTION and BIOCSDIRECTION get or set the setting determining
whether incoming, outgoing, or all packets on the interface should be
returned by BPF.  Set to BPF_D_IN to see only incoming packets on the
interface.  Set to BPF_D_INOUT to see packets originating locally and
remotely on the interface.  Set to BPF_D_OUT to see only outgoing
packets on the interface.  This setting is initialized to BPF_D_INOUT
by default.  BIOCGSEESENT and BIOCSSEESENT are obsoleted by these but
kept for backward compatibility.

- BIOCFEEDBACK sets packet feedback mode.  This allows injected packets
to be fed back as input to the interface when output via the interface is
successful.  When BPF_D_INOUT direction is set, injected outgoing packet
is not returned by BPF to avoid duplication.  This flag is initialized to
zero by default.

Note that libpcap has been modified to support BPF_D_OUT direction for
pcap_setdirection(3) and PCAP_D_OUT direction is functional now.

Reviewed by:	rwatson
2007-02-26 22:24:14 +00:00
Sam Leffler
34c97c7db9 sigh, put back buffer overflow fix of 1.1.11 that seems to have
not gone into the 0.9.4 release; don't put it on the vendor branch
so we won't lose it on the next import if they continue to lose it
2006-09-04 20:12:45 +00:00
Sam Leffler
5d18909f05 Import of libpcap v0.9.4 2006-09-04 19:43:23 +00:00
Sam Leffler
04679efc46 correct dlt buffer alloc; this goes on the vendor branch as it
will be committed there shortly

MFC after:	3 days
2006-01-16 20:33:23 +00:00
Sam Leffler
ee2dd488bf Virgin import of libpcap v0.9.1 (release) from tcpdump.org
Approved by:	re (scottl)
2005-07-11 03:24:53 +00:00
Sam Leffler
04fb274578 Virgin import of libpcap v0.9.1 (alpha 096) from tcpdump.org 2005-05-29 17:46:52 +00:00
Bruce M Simpson
feb4ecdbac Import libpcap 0.8.3, from http://www.tcpdump.org/releases/libpcap-0.8.3.tar.gz 2004-03-31 09:07:39 +00:00
Bill Fenner
09f33d614a Commit tcpdump.org's multi-DLT support to vendor branch. 2003-01-26 01:16:33 +00:00
Bill Fenner
0a94d38f05 Import libpcap 0.7.1, from
http://www.tcpdump.org/release/libpcap-0.7.1.tar.gz
2002-06-21 01:36:27 +00:00
Bill Fenner
dc2c730546 Virgin import of tcpdump.org libpcap v0.6.2 2001-04-03 04:18:09 +00:00
Bill Fenner
8751327cb4 Virgin import of tcpdump.org libpcap v0.5 2000-01-30 00:32:56 +00:00
Bill Fenner
a4b5b39fce Virgin import of LBL libpcap v0.4 1998-09-15 19:28:10 +00:00
Bill Fenner
3052b2361a Virgin import of libpcap 0.3 1997-05-27 00:01:12 +00:00
Paul Traina
8cf6c252e7 Virgin import of LBL libpcap version 0.2.1.
Obtained from: ftp://ftp.ee.lbl.gov/libpcap.tar.Z on 19-Aug-1996.
1996-08-19 20:36:34 +00:00