summaryrefslogtreecommitdiff
path: root/pcap.h
diff options
context:
space:
mode:
authorguy <guy>2000-10-28 00:01:26 +0000
committerguy <guy>2000-10-28 00:01:26 +0000
commit82547471f79c2cf4a9943a222d006edc4add2d76 (patch)
tree803d1cceed386d4025205dc5ae836cc38d62b6a9 /pcap.h
parent188fee53ccbbe6b11e84ae01b10955205be5ac62 (diff)
downloadlibpcap-82547471f79c2cf4a9943a222d006edc4add2d76.tar.gz
When attaching a "bpf_program" to a "pcap_t" to use as a userland
filter, always attach a copy, as "pcap-linux.c" does; that way, after a program uses "pcap_setfilter()", it can safely use "pcap_freecode()" to free up the BPF instructions allocated by "pcap_compile()". Also, always free it up when the "pcap_t" is closed. Get rid of the "pcap_t *" argument to "pcap_freecode()", as it's not necessary. Document "pcap_freecode()", for the benefit of programs that might repeatedly compile filter programs and attach them, so that they can free them up after attaching them and avoid leaking memory for them.
Diffstat (limited to 'pcap.h')
-rw-r--r--pcap.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/pcap.h b/pcap.h
index 57b7bc9c..7d62728f 100644
--- a/pcap.h
+++ b/pcap.h
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#) $Header: /tcpdump/master/libpcap/pcap.h,v 1.30 2000-10-25 06:59:10 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/libpcap/pcap.h,v 1.31 2000-10-28 00:01:31 guy Exp $ (LBL)
*/
#ifndef lib_pcap_h
@@ -150,7 +150,7 @@ int pcap_compile(pcap_t *, struct bpf_program *, char *, int,
bpf_u_int32);
int pcap_compile_nopcap(int, int, struct bpf_program *,
char *, int, bpf_u_int32);
-void pcap_freecode(pcap_t *, struct bpf_program *);
+void pcap_freecode(struct bpf_program *);
int pcap_datalink(pcap_t *);
int pcap_snapshot(pcap_t *);
int pcap_is_swapped(pcap_t *);