Source: iftop
Version: 1.0~pre4-3
Severity: normal
Tags: patch

Dear Maintainer,


I'm using iftop with my own libpcap extension which has a 0mq socket
underneath. To exit gracefully, I need to go through pcap_close to
clean up, hence the below patch.

On exit, call pcap_close() so that any resources used internally
by libpcap can be cleaned up.

Note this has already been submitted upstream.
http://lists.beasts.org/pipermail/iftop-users/2016-September/000455.html
I'd love to have it in stretch if possible.

Thanks,

Brian


-- System Information:
Debian Release: 8.6
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Cleanup pcap on exit

On exit, call pcap_close() so that any resources used internally
by libpcap can be cleaned up.

Signed-off-by: Brian Russell <[email protected]>
---
 iftop.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/iftop.c
+++ b/iftop.c
@@ -839,6 +839,8 @@ int main(int argc, char **argv) {
     }
 
     pthread_cancel(thread);
+    pthread_join(thread, NULL);
+    pcap_close(pd);
 
     ui_finish();
     

Reply via email to