tcpdump mailing list archives
Re: Memory leak in libpcap (top of tree) and/or kernel
From: Guy Harris <guy () alum mit edu>
Date: Sat, 11 Jul 2009 14:10:46 -0700
On Jul 10, 2009, at 5:09 PM, Gianluca Varenni wrote:
I think the routine usb_cleanup_linux_mmap(pcap_t* handle) should be modified as follows:
...
I'm not too happy about querying again the fd for the RING_SIZE (it should be stored in the pcap_t structure), but I tried it on my VM and it seems to work ok. BTW, it's interesting there is a note about the missing munmap in the code...What do you think?
I've checked in and pushed a change to do the unmap; I got rid of the comment, as the answer to the question is apparently "yes", and also took the opportunity to add to the pcap_md structure a pointer and size_t, the former of which points to the memory-mapped buffer and the latter of which is the size of the buffer (i.e., it now stores the size of the mmapped region in the pcap_t structure), and used them both for the regular Linux mmapped capture and the Linux USB mmapped capture. (The FreeBSD mmapped capture already had pointers and lengths for the two regions.)
- This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.
Current thread:
- Memory leak in libpcap (top of tree) and/or kernel Gianluca Varenni (Jul 10)
- Re: Memory leak in libpcap (top of tree) and/or kernel Guy Harris (Jul 10)
- Re: Memory leak in libpcap (top of tree) and/or kernel Gianluca Varenni (Jul 10)
- Re: Memory leak in libpcap (top of tree) and/or kernel Guy Harris (Jul 11)
- Re: Memory leak in libpcap (top of tree) and/or kernel Gianluca Varenni (Jul 13)
- Re: Memory leak in libpcap (top of tree) and/or kernel Gianluca Varenni (Jul 10)
- Re: Memory leak in libpcap (top of tree) and/or Stephen Donnelly (Jul 12)
- Re: Memory leak in libpcap (top of tree) and/or kernel Guy Harris (Jul 10)